# Using @btime and printing a Vector{Vector} yields infinite loop

**URL:** https://discourse.julialang.org/t/using-btime-and-printing-a-vector-vector-yields-infinite-loop/126289
**Category:** General Usage
**Tags:** package
**Created:** [February 25, 2025, 12:34pm UTC](https://discourse.julialang.org/t/using-btime-and-printing-a-vector-vector-yields-infinite-loop/126289 "2025-02-25T12:34:09Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [February 25, 2025, 2:38pm UTC](https://discourse.julialang.org/t/using-btime-and-printing-a-vector-vector-yields-infinite-loop/126289/4 "2025-02-25T14:38:35Z")

</div>

There’s not really a difference between BenchmarkTools and Chairmarks here, except that for your example Chairmarks chooses fewer samples and finishes faster (although that’s generally a goal of Chairmarks).

In my view, if you’re using `@btime` or `@b` you’re doing so because you are looking at a performance-critical part of your code. That is inherently incompatible with printing to the terminal, in general I would say but especially in Julia, see:

> [@Julia seems an order of magnitude slower than Python when printing to the terminal, because of issue with "sleep"](https://discourse.julialang.org/t/julia-seems-an-order-of-magnitude-slower-than-python-when-printing-to-the-terminal-because-of-issue-with-sleep/78151/3):
>
> Some references: [JuliaLang/julia#36639](https://github.com/JuliaLang/julia/issues/36639), [JuliaLang/julia#43176](https://github.com/JuliaLang/julia/issues/43176), [Why is printint to a terminal slow (Discourse)](https://discourse.julialang.org/t/why-is-printing-to-a-terminal-slow/42987).

So yes, I’d say if you want to benchmark the runtime of some piece of code for which you care about performance, don’t let that code print to the terminal.

---

_[View the full topic](https://discourse.julialang.org/t/using-btime-and-printing-a-vector-vector-yields-infinite-loop/126289)._
