24 #ifndef PXR_BASE_TF_STOPWATCH_H 25 #define PXR_BASE_TF_STOPWATCH_H 33 #include "pxr/base/tf/api.h" 37 PXR_NAMESPACE_OPEN_SCOPE
99 _sampleCount += t._sampleCount;
139 uint64_t _nTicks = 0;
140 uint64_t _startTick = 0;
141 size_t _sampleCount = 0;
152 PXR_NAMESPACE_CLOSE_SCOPE
154 #endif // PXR_BASE_TF_STOPWATCH_H ARCH_API double ArchTicksToSeconds(uint64_t nTicks)
Convert a duration measured in "ticks", as returned by ArchGetTickTime(), to seconds.
TF_API std::ostream & operator<<(std::ostream &out, const TfStopwatch &s)
Output a TfStopwatch, using the format seconds.
int64_t GetMicroseconds() const
Return the accumulated time in microseconds.
ARCH_API int64_t ArchTicksToNanoseconds(uint64_t nTicks)
Convert a duration measured in "ticks", as returned by ArchGetTickTime(), to nanoseconds.
Low-cost, high-resolution timer datatype.
void Reset()
Resets the accumulated time and the sample count to zero.
double GetSeconds() const
Return the accumulated time in seconds as a double.
void Stop()
Increases the accumulated time stored in the TfStopwatch.
void AddFrom(const TfStopwatch &t)
Adds the accumulated time and sample count from t into the TfStopwatch.
int64_t GetMilliseconds() const
Return the accumulated time in milliseconds.
size_t GetSampleCount() const
Return the current sample count.
uint64_t ArchGetStartTickTime()
Get a "start" tick time for measuring an interval of time, followed by a later call to ArchGetStopTic...
int64_t GetNanoseconds() const
Return the accumulated time in nanoseconds.
uint64_t ArchGetStopTickTime()
Get a "stop" tick time for measuring an interval of time.
void Start()
Record the current time for use by the next Stop() call.
High-resolution, low-cost timing routines.