Accuracy of system timing on Intel vs Sun vs whatever?
Posted in 2009
Ok, While I'm using Java, it would be the same for C/C++. System.currentTimeMillis() returns the current system time in milliseconds. Note that depending on the hardware, the granularity of the time will vary. If you're timing a series of events, you can use System.nanoTime() which will return the current time in terms of nanoseconds. Now this is supposed to be as accurate as you can get, but still, there is some drift and I'm not sure of the granularity, even at this level. Has anyone tested the accuracy of this type of function on multiple processors, ie Intel, Sparc, PA-Risc, PowerPC, etc ...? Which processor will give you the best granularity and accuracy? (Also I guess I should include OS since you could be running Windows (ick!), Linux, AIX/Solaris/HP-UX, <insert your OS here>. Danke! _________________________________________________________________ Get back to school stuff for them and cashback for you. http://www.bing.com/cashback?form=MSHYCB&publ=WLHMTAG&crea=TEXT_MSHYCB_BackToSchool_Cashback_BTSCashback_1x1