Notice that this class will not work in Linux, since it is using Windows API. It will neither work on old hardware, since it is using the instructions on the CPU to do the actual messurment. And it has to be implemented in the hardware. To not scare you totaly away, I have never seen a computer that doesn't have it implemented.
Example of use:
Code:
GameTimer gt = new GameTimer();
for (int i = 0; i < 10; i ++){
int test = 3*9;
}
Console.WriteLine("1). Time Elapsed: " + gt.GetElapsedTime().ToString());
// Resets the timer, so you can start to time a new "event".
gt.Mark();
for (int i = 0; i < 10; i ++){
int test = 3*9;
}
Console.WriteLine("2). Time Elapsed: " + gt.GetElapsedTime().ToString());
- ØØ -