Measure time (ms) to complete task
Posted on 2003-12-12
Hi, I have console program that I'll try to optimizie for speed. I need a way to measure how long it takes to complete certain tasks. I'd like to be able to say something like this anywhere in the code:
// Start counting from here
// Do something...
// Report time in milliseconds here
Ideas? I've been looking at the Timer class, but since these are just temporary checks, I'd rather not put everything in a while block. I hope there's a way to just get the time at two points and subtract the first from the second.