* times.cc (hires_ms::prime): Remove debugging stuff.
(hires_ms::usecs): Ditto.
This commit is contained in:
parent
b0c3293ecc
commit
1740d2580b
|
@ -1,3 +1,8 @@
|
||||||
|
2005-11-30 Christopher Faylor <cgf@timesys.com>
|
||||||
|
|
||||||
|
* times.cc (hires_ms::prime): Remove debugging stuff.
|
||||||
|
(hires_ms::usecs): Ditto.
|
||||||
|
|
||||||
2005-11-30 Corinna Vinschen <corinna@vinschen.de>
|
2005-11-30 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* mmap.cc (list::try_map): New method, implementing trying to map
|
* mmap.cc (list::try_map): New method, implementing trying to map
|
||||||
|
|
|
@ -621,16 +621,11 @@ hires_ms::prime ()
|
||||||
if (!inited)
|
if (!inited)
|
||||||
{
|
{
|
||||||
FILETIME f;
|
FILETIME f;
|
||||||
// int priority = GetThreadPriority (GetCurrentThread ());
|
int priority = GetThreadPriority (GetCurrentThread ());
|
||||||
// stupid_printf ("priority %d", priority);
|
SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_TIME_CRITICAL);
|
||||||
// SetThreadPriority (GetCurrentThread (), THREAD_PRIORITY_TIME_CRITICAL);
|
|
||||||
stupid_printf ("SetThreadPriority to THREAD_PRIORITY_TIME_CRITICAL");
|
|
||||||
initime_ms = timeGetTime ();
|
initime_ms = timeGetTime ();
|
||||||
stupid_printf ("after timeGetTime");
|
|
||||||
GetSystemTimeAsFileTime (&f);
|
GetSystemTimeAsFileTime (&f);
|
||||||
stupid_printf ("after GetSystemTimeAsFileTime");
|
SetThreadPriority (GetCurrentThread (), priority);
|
||||||
// SetThreadPriority (GetCurrentThread (), priority);
|
|
||||||
// stupid_printf ("SetThreadPriority(%p, %d)", GetCurrentThread(), priority);
|
|
||||||
|
|
||||||
initime_us.HighPart = f.dwHighDateTime;
|
initime_us.HighPart = f.dwHighDateTime;
|
||||||
initime_us.LowPart = f.dwLowDateTime;
|
initime_us.LowPart = f.dwLowDateTime;
|
||||||
|
@ -638,30 +633,24 @@ stupid_printf ("after GetSystemTimeAsFileTime");
|
||||||
initime_us.QuadPart /= 10;
|
initime_us.QuadPart /= 10;
|
||||||
inited = 1;
|
inited = 1;
|
||||||
}
|
}
|
||||||
stupid_printf ("returning");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LONGLONG
|
LONGLONG
|
||||||
hires_ms::usecs ()
|
hires_ms::usecs ()
|
||||||
{
|
{
|
||||||
stupid_printf ("before call to prime(), process priority %d", GetThreadPriority (GetCurrentThread ()));
|
|
||||||
if (!inited)
|
if (!inited)
|
||||||
prime ();
|
prime ();
|
||||||
stupid_printf ("after call to prime(), process priority %d", GetThreadPriority (GetCurrentThread ()));
|
|
||||||
|
|
||||||
DWORD now = timeGetTime ();
|
DWORD now = timeGetTime ();
|
||||||
stupid_printf ("after call to timeGetTime, process priority %d", GetThreadPriority (GetCurrentThread ()));
|
|
||||||
if ((int) (now - initime_ms) < 0)
|
if ((int) (now - initime_ms) < 0)
|
||||||
{
|
{
|
||||||
stupid_printf ("special casing, process priority %d", GetThreadPriority (GetCurrentThread ()));
|
|
||||||
inited = 0;
|
inited = 0;
|
||||||
prime ();
|
prime ();
|
||||||
now = timeGetTime ();
|
now = timeGetTime ();
|
||||||
}
|
}
|
||||||
// FIXME: Not sure how this will handle the 49.71 day wrap around
|
// FIXME: Not sure how this will handle the 49.71 day wrap around
|
||||||
LONGLONG res = initime_us.QuadPart + ((LONGLONG) (now - initime_ms) * 1000);
|
LONGLONG res = initime_us.QuadPart + ((LONGLONG) (now - initime_ms) * 1000);
|
||||||
stupid_printf ("res %U, process priority %d", res, GetThreadPriority (GetCurrentThread ()));
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue