Re: [Tutor] python time

2009-12-04 Thread Alan Gauld
Only just spotted this. "spir" wrote It's not C's function, it's a Unix system call. It's been part of Unix since BSD 4.2 I am confused here. That's what I first thought (there _must_ be a way to get time more precise that seconds!). But on my system (ubuntu 9.10) I cannot find the proper

Re: [Tutor] python time

2009-11-27 Thread Modulok
>> Doesn't time.time return a float? >> >> >>> import time >> >>> help(time.time) >> Help on built-in function time in module time: >> >> time(...) >> time() -> floating point number >> >> Return the current time in seconds since the Epoch. >> Fractions of a second may be present if the

Re: [Tutor] python time

2009-11-27 Thread Kent Johnson
On Fri, Nov 27, 2009 at 6:07 PM, spir wrote: > I am confused here. That's what I first thought (there _must_ be a way to get > time more precise that seconds!). But on my system (ubuntu 9.10) I cannot > find the proper manner to use these system calls. Even from the command-line > directly. Ce

Re: [Tutor] python time

2009-11-27 Thread spir
"Alan Gauld" wrote: Thank you, Alan. > "spir" wrote > > > So, python uses C's gettimeofday() func when available > > It's not C's function, it's a Unix system call. > It's been part of Unix since BSD 4.2 > > > ftime() (millisecond), > > Also Unix and predates BSD 4.2... I am confused he

Re: [Tutor] python time

2009-11-27 Thread Alan Gauld
"spir" wrote So, python uses C's gettimeofday() func when available It's not C's function, it's a Unix system call. It's been part of Unix since BSD 4.2 ftime() (millisecond), Also Unix and predates BSD 4.2... else it has only plain second precision using time(). Which is an ANSI C

Re: [Tutor] python time

2009-11-27 Thread spir
Kent Johnson wrote: > On Wed, Nov 25, 2009 at 11:11 AM, spir wrote: > > Hello, > > > > How does python get the time in microseconds? (In other words, how would I > > get it if python (like some other languages) would provide time in whole > > seconds only?) > > Use the source...in particular,

Re: [Tutor] python time

2009-11-26 Thread Kent Johnson
On Thu, Nov 26, 2009 at 9:28 PM, Modulok wrote: > Doesn't time.time return a float? time.time() > 1259288538.576565 > > Right? Yes. I'm not at all sure I understand the original question, but one plausible interpretation is, "How does python get the time to high accuracy? I want to do that

Re: [Tutor] python time

2009-11-26 Thread Modulok
Doesn't time.time return a float? >>> import time >>> help(time.time) Help on built-in function time in module time: time(...) time() -> floating point number Return the current time in seconds since the Epoch. Fractions of a second may be present if the system clock provides them.

Re: [Tutor] python time

2009-11-26 Thread Kent Johnson
On Wed, Nov 25, 2009 at 11:11 AM, spir wrote: > Hello, > > How does python get the time in microseconds? (In other words, how would I > get it if python (like some other languages) would provide time in whole > seconds only?) Use the source...in particular, see floattime() in timemodule.c: http

Re: [Tutor] python time

2009-11-26 Thread Dave Angel
spir wrote: Hello, How does python get the time in microseconds? (In other words, how would I get it if python (like some other languages) would provide time in whole seconds only?) Thank you, Denis la vita e estrany http://spir.wikidot.com/ You need to

Re: [Tutor] python time

2009-11-25 Thread Lie Ryan
spir wrote: Hello, How does python get the time in microseconds? time.time() should provide fractional second accuracy if the system provides them. Did the system clock actually record fractional seconds? ___ Tutor maillist - Tutor@python.org T

Re: [Tutor] python time

2009-11-25 Thread Alan Gauld
"spir" wrote How does python get the time in microseconds? The underlying OS API generally provides that. (In other words, how would I get it if python (like some other languages) would provide time in whole seconds only?) You would have to call the OS routines directly from Python you

[Tutor] python time

2009-11-25 Thread spir
Hello, How does python get the time in microseconds? (In other words, how would I get it if python (like some other languages) would provide time in whole seconds only?) Thank you, Denis la vita e estrany http://spir.wikidot.com/