timer.h

来自「VIGASOCO (VIdeo GAmes SOurce COde) Windo」· C头文件 代码 · 共 35 行

H
35
字号
// Timer.h
//
//	Abstract class that defines the interface for a high resolution timer
//
//	A timer should implement 3 methods:
//		* getTime, that returns the actual number of ticks.
//		* getTicksPerSecond, that returns the number of ticks in a second.
//		* sleep, that stops execution for a specific time.
//
/////////////////////////////////////////////////////////////////////////////

#ifndef _TIMER_H_
#define _TIMER_H_


#include "Types.h"

class Timer
{
// abstract methods
public:
	virtual bool init() = 0;
	virtual void end() = 0;

	virtual INT64 getTime() = 0;
	virtual INT64 getTicksPerSecond() = 0;
	virtual void sleep(UINT32 milliseconds) = 0;

	// initialization and cleanup
	Timer(){}
	virtual ~Timer(){}
};

#endif	// _TIMER_H_

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?