Sadly though a simple time function is not very accurate and can return fairly wildly different values until a few things have stabilized, including setting up the GC well, testing overhead, etc… I’m not a fan of simple time calls like that because of reasons like that. They work better in languages like Ruby or Python where there is no JIT, but JIT’s induce an unexpected amount of changes until stabilization happens (and I don’t remember if the BEAM/HiPE is a AOT JIT or a Tracing JIT or etc…)…
AOT, there is not runtime JIT on BEAM for now. It is in the backlog/roadmap of the OTP team for a long time, but it is quite complex, would be a huge engineering work and… There is just no real big user need for it for Ericsonn
HiPE is the JIT for erlang (AOT it looks), it does not work on Windows though and although it can speed up some things it can also cause some things to be slower, it is more of a fine-tuning thing to turn on per-group of files (calling between the BEAM and HiPE modules also incurs a speed hit). ^.^