diff options
author | Tad Marshall <tad@10gen.com> | 2012-11-18 09:17:51 -0500 |
---|---|---|
committer | Tad Marshall <tad@10gen.com> | 2012-11-18 10:09:56 -0500 |
commit | 7c8dec9a7bff471724c9cf9941650462a11bd983 (patch) | |
tree | 4273f28e5b7fe784c6744691b05b2c8ad76a3b41 /src/mongo/util/timer.h | |
parent | 5cc85a542ed918ededa875d861d7ba23d482cbf1 (diff) | |
download | mongo-7c8dec9a7bff471724c9cf9941650462a11bd983.tar.gz |
SERVER-7700 Use high-resolution program uptime to track socket connection time
Switch from curTimeMicros64() to new getProgramUptimeMicros() function for
tracking socket connection time. curTimeMicros64() on Windows uses
GetSystemTimeAsFileTime(), which has a resolution of 1 to 15 milliseconds,
which is not good enough for tracking fast events. getProgramUptimeMicros()
provides program uptime instead of clock time, but uses QueryPerformanceCounter()
on Windows and so has sub-microsecond resolution.
Diffstat (limited to 'src/mongo/util/timer.h')
-rw-r--r-- | src/mongo/util/timer.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/util/timer.h b/src/mongo/util/timer.h index 12a19674b24..3368c93252b 100644 --- a/src/mongo/util/timer.h +++ b/src/mongo/util/timer.h @@ -75,6 +75,12 @@ namespace mongo { unsigned long long _old; }; + + /** Get this program's approximate uptime in microseconds. + * @return uptime in microseconds. + */ + extern unsigned long long getProgramUptimeMicros(); + } // namespace mongo #include "mongo/util/timer-inl.h" |