tags:

views:

44

answers:

2

Hi,

My question was not specific enough last time, and so this is second question about this topic. I'm running some experiments and I need to precisely measure participants' response time to questions in millisecond unit.

I know how to do this with the time module, but I was wondering if this is reliable enough or I should be careful using it. I was wondering if there are possibilities of some other random CPU load will interfere with the measuring of time.

So my question is, will the response time measure with time module be very accurate or there will be some noise associate with it?

Thank you, Joon

+1  A: 

CPU load will affect timing. If your application is startved of a slice of CPU time, then timing would get affected. You can not help that much. You can be as precise and no more. Ensure that your program gets a health slice of cpu time and the result will be accurate. In most cases, the results should be accurate to milliseconds.

pyfunc
It's good news. In the lab the computers should be only running the program for the experiment so CPU should be free.
joon
A: 

If you benchmark on a *nix system (Linux most probably), time.clock() will return CPU time in seconds. On its own, it's not very informative, but as a difference of results (i.e. t0 = time.clock(); some_process(); t = time.clock() - t0), you'd have a much more load-independent timing than with time.time().

ΤΖΩΤΖΙΟΥ
Thanks a lot. Unfortunately the lab only has Windows machines, even though my main machine is running openSUSE.
joon