highresolutiontimer.h

来自「c+++ game uploading now」· C头文件 代码 · 共 43 行

H
43
字号
/**
 @file
 Interface of a win32 timer with high resolution
*/
#if !defined _HIGHRESOLUTIONTIMER_H_
#define _HIGHRESOLUTIONTIMER_H_
#include <windows.h>

namespace Win
{
    /**
     HighResolutionTimer class, encapsulates the Win32 high resolution
     timer */
    class HighResolutionTimer
    {
    public:

        /** 
         start the clock 
         @exception throws Win::Exception upon failure */
        explicit HighResolutionTimer();

        /** 
         @return the ticks passed since last reset */
        LARGE_INTEGER Ticks();

        /** 
         @return the number of ticks in one second */
        LARGE_INTEGER Frequency();

        /**
         resets the clock */
        void InitBase();

    private:

        LARGE_INTEGER _frequency;
        LARGE_INTEGER _base;
    };
}
#endif //_HIGHRESOLUTIONTIMER_H_

⌨️ 快捷键说明

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