1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00
vcmi/timeHandler.h
Ivan Savenko 9771dd12ff - changes in LodHandler:
-- file type (text, image...) can be specified in getFile(), all hacks removed
-- replaced Nodrze with std::set
-  some gcc warnings fixed
2010-11-09 11:27:58 +00:00

29 lines
679 B
C++

#ifndef __TIMEHANDLER_H__
#define __TIMEHANDLER_H__
#include <ctime>
/*
* timeHandler.h, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
class timeHandler
{
public:
clock_t start, last, mem;
timeHandler():start(clock()){last=clock();mem=0;};
long getDif(){long ret=clock()-last;last=clock();return ret/(CLOCKS_PER_SEC/1000);};//get diff in milliseconds
void update(){last=clock();};
void remember(){mem=clock();};
long memDif(){return clock()-mem;};
};
#endif // __TIMEHANDLER_H__