# @time vs @btime

**URL:** <https://discourse.julialang.org/t/time-vs-btime/9879>\
**Category:** Performance\
**Created:** [March 22, 2018, 7:37am UTC](https://discourse.julialang.org/t/time-vs-btime/9879 "2018-03-22T07:37:22Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [March 22, 2018, 9:48am UTC](https://discourse.julialang.org/t/time-vs-btime/9879/5 "2018-03-22T09:48:38Z")

</div>

> [@leoc](#):
>
> I start Julia executable (called by a script) that execute code and exit.

Then use the `time` command of your Bash shell. For example, this times how long it takes to julia to start up and execute `sin.(rand(100000))` and exit:

```julia
 >> time julia -e "sin.(rand(100000))"                                                                                                
julia -e "sin.(rand(100000))" 3.06s user 0.08s system 99% cpu 3.154 total

```

Aside: note that usually, one times at the REPL and not inside functions. I’m not sure `@btime` is made to be used inside functions. For example as Greg does in your other thread: [Array performance Julia 0.6 vs 0.5 - #5 by greg\_plowman](https://discourse.julialang.org/t/array-performance-julia-0-6-vs-0-5/9796/5).

---

_[View the full topic](https://discourse.julialang.org/t/time-vs-btime/9879)._
