EDIT . Since this answer was first written, code for escape codes was added to Go compilers. This allows the compiler to avoid unnecessary distributions in certain situations, including (possibly) the one described below. Therefore, with the latest weeklies, it may also be useful to use a simpler time challenge. Nanoseconds (). Please do your own profiling.
( , ). , , , syscall.Gettimeofday() ( , ). . :
http://groups.google.com/group/golang-nuts/browse_thread/thread/f2209022f43efcca?pli=1
tv syscall.Timeval, :
syscall.Gettimeofday(&tv)
:
(int64(tv.Sec)*1e3 + int64(tv.Usec)/1e3)
, , . Nanoseconds() .