# UndefVarError: tic not defined

**URL:** <https://discourse.julialang.org/t/undefvarerror-tic-not-defined/17627>\
**Category:** General Usage\
**Tags:** question, package\
**Created:** [November 16, 2018, 11:28pm UTC](https://discourse.julialang.org/t/undefvarerror-tic-not-defined/17627 "2018-11-16T23:28:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yuan\_liao](https://avatars.discourse-cdn.com/v4/letter/y/d9b06d/32.png) [@yuan\_liao](https://discourse.julialang.org/u/yuan_liao)\
**Post date:** [November 16, 2018, 11:28pm UTC](https://discourse.julialang.org/t/undefvarerror-tic-not-defined/17627/1 "2018-11-16T23:28:59Z")

</div>

I typed

tic()

in Julia, and got message:

UndefVarError: tic not defined

Am I missing any package here?

---

<div class="post-metadata">

**Author:** ![tlienart](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tlienart/32/7640_2.png) [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Post date:** [November 16, 2018, 11:56pm UTC](https://discourse.julialang.org/t/undefvarerror-tic-not-defined/17627/2 "2018-11-16T23:56:30Z")

</div>

Did you want to use tic/toc à la Matlab? If so use

```julia
start = time()
...
elapsed = time() - start

```

Or use @time

---

<div class="post-metadata">

**Author:** ![Seif\_Shebl](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@Seif\_Shebl](https://discourse.julialang.org/u/Seif_Shebl)\
**Post date:** [November 17, 2018, 12:43am UTC](https://discourse.julialang.org/t/undefvarerror-tic-not-defined/17627/3 "2018-11-17T00:43:20Z")

</div>

When updating any old code to version 1.0+, it is always beneficial to run your code in version 0.7:

```julia
julia> tic()
┌ Warning: `tic()` is deprecated, use `@time`, `@elapsed`, or calls to `time_ns()` instead.
│ caller = top-level scope at none:0
└ @ Core none:0

```

The deprecation warning gives you the correct alternative(s) for your command.
