Use gethrtime instead if you want high precision time.
Floats aren't double by default since that'd make the svalue size larger. Perhaps we should move to 8 byte integers and floats soon, but it'd be nice to see some comparisons on the effects of that on different applications first. Care to collect some data?
/ Martin Stjernholm, Roxen IS
Previous text:
2003-09-19 01:05: Subject: Re: time() and optimization again
On Thu, Sep 18, 2003 at 11:00:05PM +0200, Fredrik (Naranek) Hubinette (Real Build Master) @ Pike (-) developers forum wrote:
time() was implemented this way *because* of the limited float precision. Basically, you are supposed to do this:
It is limited only by default. Frankly, I see no reason why it is not double precision by default...
int mstime() // Time in milliseconds { int t=time(); float off=time(t); return (off * 1000) + (t * 1000); }
This way I've one extra syscall, and interpeted: three float operations, two function calls and two svalues allocation/deallocation (= subject to gc()).
Not a big deal? Well, then again, I see no reason why default float type is not double precision... :)
Regards, /Al
/ Brevbäraren