0ad/source/lib/sysdep/win/whrt/tgt.h

50 lines
1.1 KiB
C
Raw Normal View History

/**
* =========================================================================
* File : tgt.h
* Project : 0 A.D.
* Description : Timer implementation using timeGetTime
* =========================================================================
*/
// license: GPL; see lib/license.txt
#ifndef INCLUDED_TGT
#define INCLUDED_TGT
#include "tick_source.h"
class TickSourceTgt : public TickSource
{
public:
TickSourceTgt();
virtual ~TickSourceTgt();
virtual const char* Name() const
{
return "TGT";
}
virtual bool IsSafe() const;
virtual u64 Ticks() const;
/**
* WHRT uses this to ensure the counter (running at nominal frequency)
* doesn't overflow more than once during CALIBRATION_INTERVAL_MS.
**/
virtual uint CounterBits() const;
/**
* initial measurement of the tick rate. not necessarily correct
* (e.g. when using TSC: cpu_ClockFrequency isn't exact).
**/
virtual double NominalFrequency() const;
/**
* actual resolution [s]
**/
virtual double Resolution() const;
};
#endif // #ifndef INCLUDED_TGT