berkus / nativeclient-sdk

Automatically exported from code.google.com/p/nativeclient-sdk
1 stars 1 forks source link

Need support for high resolution timer #138

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Platform (e.g. "pepper_14"): Default
Toolchain variant (e.g. "newlib" or "glibc"): Default

What steps will reproduce the problem?
1. Try to profile your code with gettimeofday
2. Notice that it is not high-resolution enough
3.

Please provide any additional information below.
NaCl support RDSTC, and CPUID, both of which can be used to query the frequency 
of the machine, as well as expose usage for high resolution timers. 
Example 10-6 of the INTEL document shows source code for how to do this.
http://www.intel.com/content/www/us/en/processors/processor-identification-cpuid
-instruction-note.html

Original issue reported on code.google.com by col...@google.com on 4 Oct 2011 at 4:19

GoogleCodeExporter commented 9 years ago

Original comment by dsprin...@google.com on 28 Oct 2011 at 3:01

GoogleCodeExporter commented 9 years ago
Can we update this request? Can we fix gettimeofday to use the proper 
microsecond API call for the proper platforms?
Any chance of this for M17?

Original comment by col...@google.com on 10 Dec 2011 at 3:12

GoogleCodeExporter commented 9 years ago
Well, using rdtsc to measure time is hopeless.
Counter jumps around :(
Works in native-native windows app, does not in nexe.
We decided to fix gettimeofday() instead:
http://code.google.com/p/chromium/issues/detail?id=104745
It's quite close, working on win-64 but trybots fail on win-32.

Original comment by garia...@google.com on 12 Dec 2011 at 4:56