On Tue, Jan 30, 2001 at 01:07:18PM -0800, Nathan Wiger wrote:
> If the internal timekeeping were changed, one thing that's apparent from
> the discussions is that there would *have* to be a core way of providing
> exactly what time() does currently or lots of stuff would break really
> badly. Someone can certainly chime in if they see an easy way around
> this, but as I recall there was little disagreement on this point.
I really and truly don't see why we can't have things dealing with a number
of seconds do the Right Thing with fractional seconds, including returning
them.

It isn't an issue that we don't have the resolution available; the functions
were, and will continue to be, best-effort.  There isn't a real problem with
formatting; if you're programming in p6, you should be saying int(time) if
you don't want a period.  Remember, 75% of p5 code works straight, 90% can
be translated.  time -> int(time) is easy to translate.  And having it in
the 25% that needs to change isn't that bad.  You shouldn't be using time()
to generate unique filenames becuase the time isn't unique.  Splitting on a
period is probably valid in many cirucumstances, but you can deal.

You can't make an omlet without breaking a few eggs, and this is a little
one to break.

(And please, don't get into epoch discussions here.  The units, accuracy,
resolution, and zeropoint of a measurement are all different questions.  I
personaly would prefer to see units of seconds, a basepoint of 1/1/1970, and
resolution and accuracy best-reasonably-available.)

If you really want time() to do what it did before, you can always say:
sub time {int (CORE::time()) + <epoch difference>};

Indeed, a perl5::time module that does exactly that might be a Good Thing.

           -=- James Mastros
-- 
"My country 'tis of thee, of y'all i'm rappin'!  Lan where my brothers
fought, land where our King was shot -- from every building top, let freedom
happen!"
        -=- Monique, Sinfest[.net]
AIM: theorbtwo       homepage: http://www.rtweb.net/theorb/

Reply via email to