Bug 563842: Make PRMJ_Now always high-resolution in Windows shell builds, r=brendan

This commit is contained in:
David Mandelin 2010-05-04 18:06:30 -07:00
Родитель 031310bf07
Коммит b2accb9a49
2 изменённых файлов: 13 добавлений и 2 удалений

Просмотреть файл

@ -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;