# Async usage readxml

**URL:** <https://discourse.julialang.org/t/async-usage-readxml/62380>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [June 4, 2021, 8:42am UTC](https://discourse.julialang.org/t/async-usage-readxml/62380 "2021-06-04T08:42:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gitboy16](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gitboy16/32/24906_2.png) [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Post date:** [June 4, 2021, 8:42am UTC](https://discourse.julialang.org/t/async-usage-readxml/62380/1 "2021-06-04T08:42:35Z")

</div>

hi,

I am trying use `@async` but it seems I am not using it properly. My code looks like something below. Note `url` is a dummy name.

```julia
using EzXML 

function test1()
  item = ["name1", "name2","name3"]
  url = "http://my.website/web-service/value="
  xdoc = Vector(undef, 3)
  for i in 1:3
    xdoc[i] = EzXML.readxml(string(url,item[i]))
  end
  return xdoc
end 

function test2()
  item = ["name1", "name2","name3"]
  url = "http://my.website/web-service/value="
  xdoc = Vector(undef, 3)
  @sync for i in 1:3
    @async xdoc[i] = EzXML.readxml(string(url,item[i]))
  end
  return xdoc
end 

@time test1()
  7.21 seconds (102k allocations: 7.047 KiB) 

@time test2()
  7.33 seconds (318k allocations: 26.156 KiB)

```

I would expect test2 to be faster but it is not. Would you be able to help?

Thank you  
Kind regards
