Line | Exclusive | Inclusive | Code |
---|---|---|---|
1 | using Profile | ||
2 | using BenchmarkTools | ||
3 | using Random | ||
4 | using StatProfilerHTML | ||
5 | |||
6 | function f() | ||
7 |
40 (95.24%) samples spent in f
0 (ex.), 40 (100.00%) (incl.) when called from top-level scope line 25 |
||
8 | lst = rand(50000) | ||
9 | |||
10 | for i in lst | ||
11 | 37 (88.10%) |
37 (100.00%)
samples spent calling
string
s = "List entry $(i)\r" # The \r makes it so the terminal isn't filled
|
|
12 | if i > 0.99 | ||
13 | |||
14 | 3 (7.14%) |
3 (100.00%)
samples spent calling
print
print(s)
|
|
15 | end | ||
16 | end | ||
17 | end | ||
18 | |||
19 | @profile f() | ||
20 | Profile.print() | ||
21 | statprofilehtml() | ||
22 | |||
23 | f() | ||
24 | @time f() | ||
25 | x = @benchmark f() | ||
26 | println() | ||
27 | println(x) |