From: Jan E. <ch...@in...> - 2000-10-12 08:41:17
|
Hi, I ran inton an interesting problem, which most likely is caused by ignorance and too much coffee. Anyway. I want to be able to get the current time of the system so that I can keep track ofthe current 'turn'. So, every 5 seconds (approximately, it's not a question of millisecond precision, more like +- a few hundred milliseconds. I poll for events from pysdl using the normal sdl.events_poll() and handle available events. Then when all events are handled I check for the current time using time.clock(), which according to the docs is *the* function to use for timing and benchmarking. The problem is that this method always returns the same value, such as 4.1, even when called thousands of times over several minutes. It seems that this is somehow connected to using select() on sockets, as I manage to get normal values from it after the remote peer has closed the socket i poll using select(). This is weird, but there must be a normal reason for it. It could of course be that Python 2.0b1 is buggy... Anyone else experienced the same problem? --------------------+-------------------------------------------------------- Jan 'Chakie' Ekholm | Balrog New Media http://www.balrog.fi/ Linux Inside | I'm the blue screen of death, nobody hears your screams |