ticktimer.h

来自「RGA: Biowaste Game Example This C++ app」· C头文件 代码 · 共 60 行

H
60
字号
/*
* ==============================================================================
*  Name        : TickTimer.h
*  Part of     : RGA Game Example
*  Interface   :
*  Description : application frame timer
*  Version     : 1.0
*
*  Copyright (c) 2007-2008 Nokia Corporation.
*  This material, including documentation and any related
*  computer programs, is protected by copyright controlled by
*  Nokia Corporation.
* ==============================================================================
*/

#ifndef __TICKTIMER_H__
#define __TICKTIMER_H__

#include <e32hal.h>
#include <e32base.h>


class CTickTimer : public CBase
{
public:
	CTickTimer();
	virtual ~CTickTimer();

	/**
	 * BeginTimer
	 * start computing time
	 */
	void BeginTimer();
	
	/**
	 * EndTimer
	 * compute time from last call to 'BeginTimer'
	 */
	void EndTimer();
	
	/**
	 * ElapsedSeconds
	 * @return number of seconds passed in between last calls to
	 * 'BeginTimer' and 'EndTimer'
	 */
	inline TReal64 ElapsedSeconds() const { return iElapsedSeconds; }
	
private:
	TInt64				iStartTicks;
	TInt64				iEndTicks;
	TInt64				iTickFrequency;
	TReal64				iRateInverse;

	TReal64				iElapsedSeconds;
	
};

#endif /* __TICKTIMER_H__ */

⌨️ 快捷键说明

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