Y
Hacker News
new
|
ask
|
show
|
jobs
by
Estragon
3738 days ago
say "Code took {now - INIT now} seconds to run"; # Code took 0.01111143 seconds to run
Implicit string interpolation??? What if I just want to print out the string "now"?
2 comments
oleganza
3738 days ago
Why implicit? There are braces around `now - INIT now`. In Ruby it'd be "Code took #{Time.now - start_time} seconds to run".
link
Estragon
3738 days ago
Ah, right. Thanks.
link
Scarblac
3737 days ago
If you want a real reason to be astonished, the bit with "INIT now" is run at a completely different time than the rest of the interpolation, apparently.
link