On 01/12/2015 10:36 AM, Gabor Szabo wrote:
On Mon, Jan 12, 2015 at 10:35 AM, Tobias Leich <em...@froggs.de
<mailto:em...@froggs.de>> wrote:
Also interesting might be the fact that BEGIN statements/blocks do
return a value:
say now() - BEGIN now; # parens needed to there so that it does not gobble
args
Hmm, actually it does not let me put the parens there:
$ perl6 -e 'say now() - BEGIN now;'
===SORRY!=== Error while compiling -e
Undeclared routine:
now used at line 1
This works:
$ perl6 -e 'say now - BEGIN now;'
0.0467931
but I am not sure why is that interesting. Could you elaborate please?
It's mostly interesting when you're working on the compiler, because it
gives an easy way to time how long it takes to compile the program.
One of them counts leap seconds, the other doesn't. Instant is
supposed
to be a monotonic clock, the other isn't.
Oh and Timo, I think, if I understand this correctly, they are both
monotonic in the mathematical sense.
Neither can decreases, can day?
I don't think so, but I'm not an expert in the domain.
The difference is that 'time' stops here-and-there and waits for a leap
second to pass before it resumes increasing.
Right, that's strictly monotonic vs. monotonic.
The background is that if you want to control something where the
interval is more important than the exact timing, use 'now'. You don't
want to X-ray the patient for an extra second just because there's a
leap second during the test.
Cheers,
Moritz