[erlang-questions] Erlang timer accuracy & precision

G Bulmer gbulmer@REDACTED
Sat Sep 29 01:34:56 CEST 2007

I am writing some benchmarks, and I'd like to know what is the  
accuracy and precision/sensitivity of the Erlang time mechanisms?
AFAIK I can use timer:tc(), statistics(wall_clock) and now() to get  
wall-clock/real time.

I'm trying to understand if it makes any significant difference which  
I use.

My questions are:
1. Are they all similar accuracy, or is one more accurate than the  
2. Is the aparent precision/sensitivity of (at least) a millisecond  
really available from those time sources, or is there some mechanism  
they use which is actually less precise/sensitive?
3. Are they all approximately the same cost, or is one typically  
cheaper than another?

I'm using Mac OS X 10.4 on MacBook Pro (core 2 duo) and Linux 2.6.9- 
smp (Centos 4.1) on Athlon 64 X2.

Supplementary question: does the answers to 1-3 change significantly  
with newer versions of the Linux Kernel?
I'm able to move to a 'good' kernel, but preferably something on long  
term support.

As ever, pointers, advice and suggestions are always welcome.
G Bulmer

PS - See you next week in Freiburg.

More information about the erlang-questions mailing list