Tracking Time

  • Thread starter Thread starter Joseph Lee
  • Start date Start date
J

Joseph Lee

Hi,

I am trying to track the time taken for a process to complete.

for loop //for multiple same Process
{
//Do Process
//Get Time
}

By doing this I will get a sequence of time

I have been looking at Timer class and TimeDate class for my problem below.

Timer class seems to be not what i can use as I am not having a process
being executed again and again defined by the timer class.

TimeDate seems to suit better, however due to the process taking lesser than
milliseconds to finish, I would end up have a sequence of same value(
TimeData.Now.Millisecond ).

This is not very nice, so I am wondering whether there is a way to track
nanoseconds or a better way to implement something like my above problem.

Thanks in advance

Joey.
 
Make you path execute millions of iterations or even
billions and then take the average time as (total
time)/iterations and you should get closer than most any
other way available.
 
That would work, however my mistake; I forgot to mention that my
process(same) uses different data input everytime, so depending on
situation(random in nature), some processes will be longer than the rest,
having an average is ok(final reporting) but, i would need(detail report) to
show that during time x, processes are this long while time x+a is this
long.... so i think i require a smaller scale of measurement.

Thanks for the suggestion

Joey
 
Dummy up the data and state of the execution path to
allow for repetitive execution of the same path and do
several tests.
 
P/Invoke QueryPerformanceCounter & QueryPerformanceFrequency.

Should be exact to a few nanoseconds.

Niki
 
Hmm... i am not sure how to do that in my programming, sorry still not very
good at programming. Anyway thanks for helping me out

Joey
 
Thanks, I think this is the one that will help me. Never seen it before
though. Give me some time to study it

Thanks again
Joey ^_^
 
Back
Top