That has to be a bug in the profiler extension. At least, I can't think of another explanation. (Well, are you calling profiler:reset
between runs...?)
I tried this just now:
extensions [profiler]
globals [clock]
to increment-clock
set clock (clock + 1)
if clock = 48
[ set clock 0 ]
end
to test
profiler:reset
profiler:start
repeat 1000000 [ increment-clock ]
profiler:stop
print profiler:report
end
and I get:
observer> test
BEGIN PROFILING DUMP
Sorted by Exclusive Time
Name Calls Incl T(ms) Excl T(ms) Excl/calls
INCREMENT-CLOCK 1000000 1176.245 1176.245 0.001
Sorted by Inclusive Time
INCREMENT-CLOCK 1000000 1176.245 1176.245 0.001
Sorted by Number of Calls
INCREMENT-CLOCK 1000000 1176.245 1176.245 0.001
END PROFILING DUMP
which seems much more reasonable.
You can report the bug at https://github.com/NetLogo/NetLogo/issues or bugs@ccl.northwestern.edu.