Re: time and now showing different time?

2015-01-12 Thread Carl Mäsak
Yes, this is why phasers are awesome. They allow you to write code in a "natural" order, but the phasers will basically time-travel the code around to where you send it. The two `now` calls execute in two completely different environments; the first one in the runtime, the second one during the par

Re: time and now showing different time?

2015-01-12 Thread Gabor Szabo
On Mon, Jan 12, 2015 at 11:48 AM, Tobias Leich wrote: > > $ perl6 -e 'sleep 3; say now - BEGIN now;' > 3.0180351 > > Oh, so this what they call bending time around space. (Or was that the other way around?) You call now in the BEGIN block which is the first thing to finish in that code, but it i

Re: time and now showing different time?

2015-01-12 Thread Tobias Leich
Am 12.01.2015 um 10:46 schrieb Moritz Lenz: > > > On 01/12/2015 10:36 AM, Gabor Szabo wrote: >> >> On Mon, Jan 12, 2015 at 10:35 AM, Tobias Leich > > wrote: >> >> Also interesting might be the fact that BEGIN statements/blocks do >> return a value: >> >> say now

Re: time and now showing different time?

2015-01-12 Thread Tobias Leich
Ohh, 'now' is a term and therefore doesnt need parens... good :o) It is interesting in a way because you don't have to go back to a certain point of code to assign 'now' to a variable, you can you put that signle line anywhere in your code and get some measurement. Imagine you've got a routine th

Re: time and now showing different time?

2015-01-12 Thread Moritz Lenz
On 01/12/2015 10:36 AM, Gabor Szabo wrote: On Mon, Jan 12, 2015 at 10:35 AM, Tobias Leich 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

Re: time and now showing different time?

2015-01-12 Thread Gabor Szabo
On Mon, Jan 12, 2015 at 10:35 AM, Tobias Leich 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 -

Re: time and now showing different time?

2015-01-12 Thread Tobias Leich
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 Am 12.01.2015 um 08:55 schrieb Gabor Szabo: > Neat. Based on that I tried to explain it > here: http://perl6maven.com/tutorial/timest

Re: time and now showing different time?

2015-01-11 Thread Gabor Szabo
Neat. Based on that I tried to explain it here: http://perl6maven.com/tutorial/timestamp Gabor On Sat, Jan 10, 2015 at 4:13 PM, wrote: > > On 01/10/2015 03:12 PM, Gabor Szabo wrote: > > > say time; say now; say time; say now; > > > > 1420898839 > > Instant:1420898874.659941 > > 1420898839 > > In

Re: time and now showing different time?

2015-01-10 Thread timo
On 01/10/2015 03:12 PM, Gabor Szabo wrote: > > say time; say now; say time; say now; > > 1420898839 > Instant:1420898874.659941 > 1420898839 > Instant:1420898874.663946 > > This looks really strange to me. > Why do the calls to 'now' show different full seconds than the calls > to 'time' ? > > Gab

time and now showing different time?

2015-01-10 Thread Gabor Szabo
> say time; say now; say time; say now; 1420898839 Instant:1420898874.659941 1420898839 Instant:1420898874.663946 This looks really strange to me. Why do the calls to 'now' show different full seconds than the calls to 'time' ? Gabor