| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. |
| 3 * Copyright (C) 2008 Google Inc. All rights reserved. | 3 * Copyright (C) 2008 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions are | 6 * modification, are permitted provided that the following conditions are |
| 7 * met: | 7 * met: |
| 8 * | 8 * |
| 9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "wtf/WTFExport.h" | 35 #include "wtf/WTFExport.h" |
| 36 | 36 |
| 37 namespace WTF { | 37 namespace WTF { |
| 38 | 38 |
| 39 // Returns the current UTC time in seconds, counted from January 1, 1970. | 39 // Returns the current UTC time in seconds, counted from January 1, 1970. |
| 40 // Precision varies depending on platform but is usually as good or better | 40 // Precision varies depending on platform but is usually as good or better |
| 41 // than a millisecond. | 41 // than a millisecond. |
| 42 WTF_EXPORT double currentTime(); | 42 WTF_EXPORT double currentTime(); |
| 43 | 43 |
| 44 // Same thing, in milliseconds. | 44 // Same thing, in milliseconds. |
| 45 inline double currentTimeMS() | 45 inline double currentTimeMS() { |
| 46 { | 46 return currentTime() * 1000.0; |
| 47 return currentTime() * 1000.0; | |
| 48 } | 47 } |
| 49 | 48 |
| 50 // Provides a monotonically increasing time in seconds since an arbitrary point
in the past. | 49 // Provides a monotonically increasing time in seconds since an arbitrary point
in the past. |
| 51 // On unsupported platforms, this function only guarantees the result will be no
n-decreasing. | 50 // On unsupported platforms, this function only guarantees the result will be no
n-decreasing. |
| 52 WTF_EXPORT double monotonicallyIncreasingTime(); | 51 WTF_EXPORT double monotonicallyIncreasingTime(); |
| 53 | 52 |
| 54 typedef double(*TimeFunction)(void); | 53 typedef double (*TimeFunction)(void); |
| 55 void setCurrentTimeFunction(TimeFunction); | 54 void setCurrentTimeFunction(TimeFunction); |
| 56 WTF_EXPORT void setMonotonicallyIncreasingTimeFunction(TimeFunction); | 55 WTF_EXPORT void setMonotonicallyIncreasingTimeFunction(TimeFunction); |
| 57 | 56 |
| 58 } // namespace WTF | 57 } // namespace WTF |
| 59 | 58 |
| 60 using WTF::currentTime; | 59 using WTF::currentTime; |
| 61 using WTF::currentTimeMS; | 60 using WTF::currentTimeMS; |
| 62 using WTF::monotonicallyIncreasingTime; | 61 using WTF::monotonicallyIncreasingTime; |
| 63 | 62 |
| 64 #endif // CurrentTime_h | 63 #endif // CurrentTime_h |
| OLD | NEW |