# Benchmarking inside a module

**URL:** <https://discourse.julialang.org/t/benchmarking-inside-a-module/46967>\
**Category:** General Usage\
**Created:** [September 20, 2020, 8:23pm UTC](https://discourse.julialang.org/t/benchmarking-inside-a-module/46967 "2020-09-20T20:23:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pauljurczak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pauljurczak/32/921_2.png) [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Post date:** [September 20, 2020, 8:23pm UTC](https://discourse.julialang.org/t/benchmarking-inside-a-module/46967/1 "2020-09-20T20:23:08Z")

</div>

I’m trying to get benchmark results of a function inside a module displayed in REPL. Here is an example:

```julia
module Ex9
using BenchmarkTools

a = rand(100, 100)

function foo(a)
  m = maximum(a)
  map(x -> x<0 ? 0 : x<0.8m ? 1 : x<0.98m ? 2 : 3, a)
end

@benchmark foo($a)
end

```

Executing this file in VSCode doesn’t show benchmark results. If I change it to:

```julia
....
println(@benchmark foo($a))
....

```

it works a bit better, producing:

```julia
Trial(8.732 μs)

```

but I would prefer the standard `@benchmark` output. How can I do it?

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [September 20, 2020, 8:46pm UTC](https://discourse.julialang.org/t/benchmarking-inside-a-module/46967/3 "2020-09-20T20:46:41Z")

</div>

```julia
 show(stdout, MIME("text/plain"), @benchmark foo($a))

```
