Re: Anomaly in time.clock()

2008-03-22 Thread Craig
On Mar 22, 10:03 pm, Tim Roberts <[EMAIL PROTECTED]> wrote: > Godzilla <[EMAIL PROTECTED]> wrote: > > >Just found out that win32api.GetTickCount() returns a tick count in > >milli-second since XP started. Not sure whether that is reliable. > >Anyone uses that for calculating elapsed time? > > What

Re: Anomaly in time.clock()

2008-03-22 Thread Tim Roberts
Godzilla <[EMAIL PROTECTED]> wrote: > >Just found out that win32api.GetTickCount() returns a tick count in >milli-second since XP started. Not sure whether that is reliable. >Anyone uses that for calculating elapsed time? What do you mean by "reliable"? The tick count is updated as part of schedu

Re: Anomaly in time.clock()

2008-03-21 Thread Gabriel Genellina
On 21 mar, 03:13, Godzilla <[EMAIL PROTECTED]> wrote: > Just found out that win32api.GetTickCount() returns a tick count in > milli-second since XP started. Not sure whether that is reliable. > Anyone uses that for calculating elapsed time? I use GetTickCount on other languages because it's easy

Re: Anomaly in time.clock()

2008-03-21 Thread Gabriel Genellina
On 20 mar, 08:47, Godzilla <[EMAIL PROTECTED]> wrote: > Thanks Ross and John for your help. I apologise for the code I posted > earlier not being the full picture of what I was trying to achieve. I > had instantiated multiple instances of elapseTime class and each of > them gets called approximate

Re: Anomaly in time.clock()

2008-03-20 Thread Godzilla
Just found out that win32api.GetTickCount() returns a tick count in milli-second since XP started. Not sure whether that is reliable. Anyone uses that for calculating elapsed time? -- http://mail.python.org/mailman/listinfo/python-list

Re: Anomaly in time.clock()

2008-03-20 Thread Godzilla
Thanks Ross and John for your help. I apologise for the code I posted earlier not being the full picture of what I was trying to achieve. I had instantiated multiple instances of elapseTime class and each of them gets called approximately the same time. Below is the updated code: import time impo

Re: Anomaly in time.clock()

2008-03-19 Thread John Machin
On Mar 19, 11:17 pm, Godzilla <[EMAIL PROTECTED]> wrote: > Hi John, > > I am using time.clock to calculate the elapsed time. Below is an > example of what I was trying to do: > > import time > import thread Silly me, not being able to infer that from your initial post! [snip] > > But the time.clo

Re: Anomaly in time.clock()

2008-03-19 Thread Ross Ridge
Godzilla <[EMAIL PROTECTED]> wrote: >But the time.clock() sometimes return a value of between -3.5 to -4.5 >seconds backward. There are race conditions in your code. In between the time you execute "curTime = time.clock()" and calculate "curTime - self.timeStamp" in one thread, the other thread

Re: Anomaly in time.clock()

2008-03-19 Thread Godzilla
Hi John, I am using time.clock to calculate the elapsed time. Below is an example of what I was trying to do: import time import thread class elapseTime: def __init__(self, name=''): self.name = name self.timeStamp = None self.checkTimeFlag = False thread.start_new_t

Re: Anomaly in time.clock()

2008-03-18 Thread John Machin
On Mar 18, 9:43 pm, Godzilla <[EMAIL PROTECTED]> wrote: > Thanks Roel. If there is a way to pass in the PRESERVE_PRECISION > constant in the python time.clock library, that would be great Re-read Roel's message. Something like PRESERVE_PRECISION is to be passed to whatever is setting up DirectX.

Re: Anomaly in time.clock()

2008-03-18 Thread Godzilla
Thanks Roel. If there is a way to pass in the PRESERVE_PRECISION constant in the python time.clock library, that would be great. But I'm afraid it's not possible. I think I will change away from using time.clock() from now on... seems too edgy to me. Thank you for sharing your experience with me n

Re: Anomaly in time.clock()

2008-03-17 Thread Roel Schroeven
Godzilla schreef: > Hello, > > I have been reading a thread about time.clock() going backward, which > is exactly what I am seeing... the thread generally leaning toward the > problem is caused by multi-processor machines. But I am seeing it at a > single CPU computer, and running XP. > > The err

Anomaly in time.clock()

2008-03-17 Thread Godzilla
Hello, I have been reading a thread about time.clock() going backward, which is exactly what I am seeing... the thread generally leaning toward the problem is caused by multi-processor machines. But I am seeing it at a single CPU computer, and running XP. The error I am seeing between two very cl