Where can I find a good timer function in C?

Started by
2 comments, last by GameDev.net 24 years, 4 months ago
If your working in MSVC then all you have to do is run the profiler. That will give you details such as how long each function runs for and how many times it was called.. etc.
William Reiach - Human Extrodinaire

Marlene and Me


Advertisement
DeNovo,
Check out the mmsystem.h files.. Borland lists the help under Multimedia API reference. They have some neat timers in there.

Good luck-

Six

I'm looking for a timer function for evaluating the effectiveness of my code, but can't find anything anywhere.
I found a timer lib (StartTimer and EndTimer) but that has to be called from ASM and I don't know how to do it.
Please, could someone help me with this?
You can use the MMSYSTEM call TimeGetTime() to retrieve the number of millisenconds since Windows started, accurate to within 1 millisecond. By taking away successive calls to this function you can find out how fast your code is going.

Depending on the code, you might have to make it repeat a few times to get a good reading.

This topic is closed to new replies.

Advertisement