| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 | 5 |
| 6 // Windows Timer Primer | 6 // Windows Timer Primer |
| 7 // | 7 // |
| 8 // A good article: http://www.ddj.com/windows/184416651 | 8 // A good article: http://www.ddj.com/windows/184416651 |
| 9 // A good mozilla bug: http://bugzilla.mozilla.org/show_bug.cgi?id=363258 | 9 // A good mozilla bug: http://bugzilla.mozilla.org/show_bug.cgi?id=363258 |
| 10 // | 10 // |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 FILETIME ft; | 232 FILETIME ft; |
| 233 if (is_local) | 233 if (is_local) |
| 234 success = FileTimeToLocalFileTime(&utc_ft, &ft); | 234 success = FileTimeToLocalFileTime(&utc_ft, &ft); |
| 235 else | 235 else |
| 236 ft = utc_ft; | 236 ft = utc_ft; |
| 237 | 237 |
| 238 // FILETIME in SYSTEMTIME (exploded). | 238 // FILETIME in SYSTEMTIME (exploded). |
| 239 SYSTEMTIME st; | 239 SYSTEMTIME st; |
| 240 if (!success || !FileTimeToSystemTime(&ft, &st)) { | 240 if (!success || !FileTimeToSystemTime(&ft, &st)) { |
| 241 NOTREACHED() << "Unable to convert time, don't know why"; | 241 NOTREACHED() << "Unable to convert time, don't know why"; |
| 242 ZeroMemory(exploded, sizeof(exploded)); | 242 ZeroMemory(exploded, sizeof(*exploded)); |
| 243 return; | 243 return; |
| 244 } | 244 } |
| 245 | 245 |
| 246 exploded->year = st.wYear; | 246 exploded->year = st.wYear; |
| 247 exploded->month = st.wMonth; | 247 exploded->month = st.wMonth; |
| 248 exploded->day_of_week = st.wDayOfWeek; | 248 exploded->day_of_week = st.wDayOfWeek; |
| 249 exploded->day_of_month = st.wDay; | 249 exploded->day_of_month = st.wDay; |
| 250 exploded->hour = st.wHour; | 250 exploded->hour = st.wHour; |
| 251 exploded->minute = st.wMinute; | 251 exploded->minute = st.wMinute; |
| 252 exploded->second = st.wSecond; | 252 exploded->second = st.wSecond; |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 | 418 |
| 419 // static | 419 // static |
| 420 int64 TimeTicks::GetQPCDriftMicroseconds() { | 420 int64 TimeTicks::GetQPCDriftMicroseconds() { |
| 421 return HighResNowSingleton::GetInstance()->GetQPCDriftMicroseconds(); | 421 return HighResNowSingleton::GetInstance()->GetQPCDriftMicroseconds(); |
| 422 } | 422 } |
| 423 | 423 |
| 424 // static | 424 // static |
| 425 bool TimeTicks::IsHighResClockWorking() { | 425 bool TimeTicks::IsHighResClockWorking() { |
| 426 return HighResNowSingleton::GetInstance()->IsUsingHighResClock(); | 426 return HighResNowSingleton::GetInstance()->IsUsingHighResClock(); |
| 427 } | 427 } |
| OLD | NEW |