Use something like clock() or GetTickCount() or, more precise, timeGetTime().
Just take a value when you begin and then take one value when you stop and subtract and you have the time it took to execute.
Oh thanks
EDIT
Code:[Linker error] undefined reference to `timeGetTime@0'
Last edited by HelpLol; 02-17-2008 at 08:33 PM.
oh thanks. Got it working.
> Sleep can also sleep less than the specified interval in some cases. But it sleeps roughly the amount of time specified by the code. And of course you can pass a variable with the time to the function.
Cool, very helpful -- I always thought Sleep() was guaranteed to sleep for at least n seconds. Apparently not.