20#include "mongo/client/export_macros.h"
37 static const long long millisPerSecond = 1000;
38 static const long long microsPerSecond = 1000 * millisPerSecond;
39 static const long long nanosPerSecond = 1000 * microsPerSecond;
42 int seconds()
const {
return (
int)(micros() / 1000000); }
43 int millis()
const {
return (
int)(micros() / 1000); }
44 int minutes()
const {
return seconds() / 60; }
51 const long long nextNow = now();
52 const long long deltaMicros =
53 static_cast<long long>((nextNow - _old) * _microsPerCount);
56 return static_cast<int>(deltaMicros / 1000);
59 inline long long micros()
const {
60 return static_cast<long long>((now() - _old) * _microsPerCount);
63 inline void reset() { _old = now(); }
65 inline static void setCountsPerSecond(
long long countsPerSecond) {
66 _countsPerSecond = countsPerSecond;
67 _microsPerCount =
static_cast<double>(microsPerSecond) / _countsPerSecond;
70 inline static long long getCountsPerSecond() {
71 return _countsPerSecond;
80 static long long _countsPerSecond;
84 static double _microsPerCount;
86 long long now()
const;
Time tracking object.
Definition timer.h:35
int millisReset()
Get the time interval and reset at the same time.
Definition timer.h:50
the main MongoDB namespace
Definition bulk_operation_builder.h:24