Larry Wall wrote:
The time function always returns the time in floating point.
I don't understand why time() should return a numeric value at all.
Surely it should return a DateTime (or Time) object. Using epochs in a
high level language seems like a really bad thing to be doing. If I want
"duration since epoch" then I should subtract the epoch from the time --
resulting in a duration (which may indeed be a floating point value).
my DateTime $epoch is constant = DateTime "2000-01-01 00:00:00";
my Num $seconds_since_epoch = time - $epoch;
> In fact,
> all numeric times are Num in Perl 6. Then you don't have to worry
> about whether picosecond resolution is good enough. Time and
> duration objects can, of course, do whatever they like internally,
> and among themselves, but someone who says sleep($PI) should get a
> $PI second sleep.
For the sleep function, it seems reasonable to accept either a DateTime
or a Duration, which would sleep either until the requested time, or for
the requested duration.
Sorry about the rant, but you seem to have pushed one of my hot buttons...
Ditto
Larry