home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AI Game Programming Wisdom
/
AIGameProgrammingWisdom.iso
/
SourceCode
/
06 General Architectures
/
04 Christian
/
gametime.cpp
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
2001-09-16
|
406 b
|
30 lines
#include "gametime.h"
#include <stdio.h>
double GameTime::dt = 0.016f;
GameTime::GameTime ()
{
}
void GameTime::start ()
{
m_startTime = clock();
}
void GameTime::end ()
{
dt = 0.0f;
// force dt to be slow for our text game
while ( dt < 0.3f )
{
m_endTime = clock();
dt = (double)(m_endTime - m_startTime) / CLOCKS_PER_SEC;
}
}