4 ms·
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 th
by Estragon 11y 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"?
- oleganza 11y agoWhy implicit? There are braces around `now - INIT now`. In Ruby it'd be "Code took #{Time.now - start_time} seconds to run".
- Estragon 11y agoAh, right. Thanks.
- Scarblac 11y agoIf 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.