Skip to main content
GameDev.net gamedev.net
🔒 Locked

Capturing time

Started by braugh Apr 18, 2004 at 9:43 PM 1 replies 300+ views
Original Post
braugh
braugh
I need to capture a beginning time and an ending time to see how long a functions runs, using: time_t start,end; long dif; time(&start); function(); time(&end); Will only give me to the nearest second, what I want is milliseconds. I seem to remember using gettimeofday() a year or two ago, but for some reason it doesn''t work in MSVC6. How can I capture this time I want in milliseconds?
JohnBolton
JohnBolton
Use the QueryPerformanceCounter functions (you said MSVC 6, so I am assuming you are using Windows).
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
braugh
braugh
Thanks, never heard of it. Am looking into it.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.