# Confusing behavior of btime

**URL:** https://discourse.julialang.org/t/confusing-behavior-of-btime/82695
**Category:** General Usage
**Tags:** benchmarktools
**Created:** [June 13, 2022, 5:30pm UTC](https://discourse.julialang.org/t/confusing-behavior-of-btime/82695 "2022-06-13T17:30:17Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)
#### Post date: [June 13, 2022, 5:48pm UTC](https://discourse.julialang.org/t/confusing-behavior-of-btime/82695/2 "2022-06-13T17:48:49Z")

</div>

Sub-nanosecond (less than one clock cycle) results indicate that your benchmark has been compiled away (constant propagation is your “enemy” here). You can wrap the integer literal into a `Ref` to avoid constant propagation.

```julia
julia> f(x) = x^2
f (generic function with 1 method)

julia> @btime f(123456789);
  0.043 ns (0 allocations: 0 bytes)

julia> @btime f(Ref(123456789)[]);
  1.513 ns (0 allocations: 0 bytes)

julia> x = 123456789;

julia> @btime f($x);
  1.514 ns (0 allocations: 0 bytes)

```

---

_[View the full topic](https://discourse.julialang.org/t/confusing-behavior-of-btime/82695)._
