Changeset 54183 in webkit for trunk/JavaScriptCore/wtf/CurrentTime.cpp
- Timestamp:
- Feb 1, 2010, 5:33:52 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/wtf/CurrentTime.cpp
r52791 r54183 60 60 #elif PLATFORM(WX) 61 61 #include <wx/datetime.h> 62 #elif PLATFORM(BREWMP) 63 #include <AEEStdLib.h> 62 64 #else // Posix systems relying on the gettimeofday() 63 65 #include <sys/time.h> … … 278 280 } 279 281 282 #elif PLATFORM(BREWMP) 283 284 // GETUTCSECONDS returns the number of seconds since 1980/01/06 00:00:00 UTC, 285 // and GETTIMEMS returns the number of milliseconds that have elapsed since the last 286 // occurrence of 00:00:00 local time. 287 // We can combine GETUTCSECONDS and GETTIMEMS to calculate the number of milliseconds 288 // since 1970/01/01 00:00:00 UTC. 289 double currentTime() 290 { 291 // diffSeconds is the number of seconds from 1970/01/01 to 1980/01/06 292 const unsigned diffSeconds = 315964800; 293 return static_cast<double>(diffSeconds + GETUTCSECONDS() + ((GETTIMEMS() % 1000) / msPerSecond)); 294 } 295 280 296 #else // Other Posix systems rely on the gettimeofday(). 281 297
Note:
See TracChangeset
for help on using the changeset viewer.