mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-31 19:10:36 +00:00
Bug 563842: Make PRMJ_Now always high-resolution in Windows shell builds, r=brendan
This commit is contained in:
parent
031310bf07
commit
b2accb9a49
@ -407,6 +407,11 @@ def PRMJ_Now():
|
||||
|
||||
*/
|
||||
|
||||
// We parameterize the delay count just so that shell builds can
|
||||
// set it to 0 in order to get high-resolution benchmarking.
|
||||
// 10 seems to be the number of calls to load with a blank homepage.
|
||||
int CALIBRATION_DELAY_COUNT = 10;
|
||||
|
||||
JSInt64
|
||||
PRMJ_Now(void)
|
||||
{
|
||||
@ -424,8 +429,7 @@ PRMJ_Now(void)
|
||||
This does not appear to be needed on Vista as the timeBegin/timeEndPeriod
|
||||
calls seem to immediately take effect. */
|
||||
int thiscall = JS_ATOMIC_INCREMENT(&nCalls);
|
||||
/* 10 seems to be the number of calls to load with a blank homepage */
|
||||
if (thiscall <= 10) {
|
||||
if (thiscall <= CALIBRATION_DELAY_COUNT) {
|
||||
LowResTime(&ft);
|
||||
return (FILETIME2INT64(ft)-win2un)/10L;
|
||||
}
|
||||
|
@ -5010,6 +5010,13 @@ main(int argc, char **argv, char **envp)
|
||||
argc--;
|
||||
argv++;
|
||||
|
||||
#ifdef XP_WIN
|
||||
// Set the timer calibration delay count to 0 so we get high
|
||||
// resolution right away, which we need for precise benchmarking.
|
||||
extern int CALIBRATION_DELAY_COUNT;
|
||||
CALIBRATION_DELAY_COUNT = 0;
|
||||
#endif
|
||||
|
||||
rt = JS_NewRuntime(64L * 1024L * 1024L);
|
||||
if (!rt)
|
||||
return 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user