Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

Lamp::Timer Class Reference

タイマ More...

#include <Timer.h>

List of all members.

Static Public Member Functions

void initialize ()
 タイマを初期化します

Tick getTick ()
 時間の取得

float getInterval (const Tick &previousTick)
 時間間隔の取得

float getInterval (const Tick &previousTick, const Tick &afterTick)
 時間間隔の取得


Detailed Description

タイマ

時間間隔を計測します。
タイマを使用するためには、まずシステムの初期化時に Timer::initialize()を 呼んでください。その後時間を計測したい処理の前で Timer::getTick()を呼び、 計測したい処理の後で Timer::getInterval() を呼んでください。

サンプルコード

// 初期化 Timer::initialize(); // 計測開始時間の取得 Timer::Tick startTime = Timer::getTick(); // 時間を計測する処理 targetMethod1(); // 時間間隔の取得 float msTime = Timer::getInterval(startTime); // デバッグ出力に表示 DebugOut("targetMethod1() using %fms\n", msTime);

Definition at line 54 of file Timer.h.


Member Function Documentation

float Lamp::Timer::getInterval const Tick previousTick,
const Tick afterTick
[static]
 

時間間隔の取得

以前に取得した時間から以後に取得した時間の時間間隔をミリ秒単位で取得します。

Parameters:
previousTick 以前に取得した時間
afterTick 以後に取得した時間
Returns:
ミリ秒単位での時間間隔

Definition at line 67 of file Timer.cpp.

References Lamp::Timer::Tick::tick.

float Lamp::Timer::getInterval const Tick previousTick  )  [static]
 

時間間隔の取得

以前に取得した時間からの時間間隔をミリ秒単位で取得します。

Parameters:
previousTick 以前に取得した時間
Returns:
ミリ秒単位での時間間隔

Definition at line 61 of file Timer.cpp.

References getTick(), and Lamp::Timer::Tick::tick.

Timer::Tick Lamp::Timer::getTick  )  [static]
 

時間の取得

Returns:
getTick()を呼んだ時間。
See also:
Tick

Definition at line 54 of file Timer.cpp.

Referenced by getInterval().

void Lamp::Timer::initialize  )  [static]
 

タイマを初期化します

システムの初期化時に一度呼び出してください。

Definition at line 40 of file Timer.cpp.

References ErrorOut, and Lamp::Timer::Tick::tick.


The documentation for this class was generated from the following files:
Generated on Wed Mar 16 10:29:53 2005 for Lamp by doxygen 1.3.2