# @elapsed for function with return values

**URL:** https://discourse.julialang.org/t/elapsed-for-function-with-return-values/44180
**Category:** General Usage
**Tags:** question, performance
**Created:** [August 3, 2020, 9:45am UTC](https://discourse.julialang.org/t/elapsed-for-function-with-return-values/44180 "2020-08-03T09:45:01Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![yxieGT](https://avatars.discourse-cdn.com/v4/letter/y/e0b2c6/32.png) [@yxieGT](https://discourse.julialang.org/u/yxieGT)
#### Post date: [August 3, 2020, 9:45am UTC](https://discourse.julialang.org/t/elapsed-for-function-with-return-values/44180/1 "2020-08-03T09:45:01Z")

</div>

Is there a macro in Julia to return the elapsed time of a function with return values?

---

<div class="post-metadata">

### Author: ![bernhard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bernhard/32/2619_2.png) [@bernhard](https://discourse.julialang.org/u/bernhard)
#### Post date: [August 3, 2020, 10:40am UTC](https://discourse.julialang.org/t/elapsed-for-function-with-return-values/44180/2 "2020-08-03T10:40:14Z")

</div>

```julia
julia> elapsedtime = @elapsed resultoffunciton = sqrt(11)
6.0e-7

julia> elapsedtime
6.0e-7

julia> resultoffunciton
3.3166247903554

```
