Bug 489815 - nsIIdleService.idleTime returns a value in microseconds on WinCE, and in milliseconds everywhere else. r=emaijala
authorFlorian Quèze <florian@instantbird.org>
Sat, 25 Apr 2009 16:32:18 +0200
changeset 27853 ac4d8886164ce0cbc30718e890c47cac33b6d9e0
parent 27852 f6d27eb05ec18f3aec77544a4d805c80e0043ffd
child 27855 857aabc781ccd83610c340555bd002afba27b327
push id6741
push userflorian@queze.net
push dateSat, 25 Apr 2009 14:33:49 +0000
treeherdermozilla-central@ac4d8886164c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersemaijala
bugs489815
milestone1.9.2a1pre
Bug 489815 - nsIIdleService.idleTime returns a value in microseconds on WinCE, and in milliseconds everywhere else. r=emaijala
widget/src/windows/nsIdleServiceWin.cpp
--- a/widget/src/windows/nsIdleServiceWin.cpp
+++ b/widget/src/windows/nsIdleServiceWin.cpp
@@ -63,13 +63,13 @@ nsIdleServiceWin::GetIdleTime(PRUint32 *
         return NS_ERROR_FAILURE;
 
     *aTimeDiff = SAFE_COMPARE_EVEN_WITH_WRAPPING(GetTickCount(), inputInfo.dwTime);
 #else
     // NOTE: nowTime is not necessarily equivalent to GetTickCount() return value
     //       we need to compare apples to apples - hence the nowTime variable
     PRUint32 nowTime = PR_IntervalToMicroseconds(PR_IntervalNow());
 
-    *aTimeDiff = SAFE_COMPARE_EVEN_WITH_WRAPPING(nowTime, gLastInputEventTime);
+    *aTimeDiff = SAFE_COMPARE_EVEN_WITH_WRAPPING(nowTime, gLastInputEventTime) / 1000;
 #endif
 
     return NS_OK;
 }