📄 stopwatch.h
字号:
// Stopwatch.h: interface for the CStopwatch class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_STOPWATCH_H__5E9C853C_15D5_42BD_B945_3D5C1A77B481__INCLUDED_)
#define AFX_STOPWATCH_H__5E9C853C_15D5_42BD_B945_3D5C1A77B481__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "windows.h"
class IStopwatch:public IUnknown
{
public:
virtual HRESULT _stdcall Start()=0;
virtual HRESULT _stdcall ElapsedTime(float *Time)=0;
};
class CStopwatch : public IStopwatch
{
public:
CStopwatch();
virtual ~CStopwatch();
private:
// n_mFrequency-->记录时钟频率
LARGE_INTEGER m_nFrequency;
// m_nStartTime-->记录开始记时的时间
LARGE_INTEGER m_nStartTime;
long m_nReferenceCount;
public:
HRESULT _stdcall QueryInterface(REFIID riid,void **ppvObject);
unsigned long _stdcall AddRef();
unsigned long _stdcall Release();
// 开始记时,并把开始记时的时间传给m_nStartTime;
HRESULT _stdcall Start();
// 将时间差传给Time;
HRESULT _stdcall ElapsedTime(float *Time);
};
#endif // !defined(AFX_STOPWATCH_H__5E9C853C_15D5_42BD_B945_3D5C1A77B481__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -