Skip to content

Instantly share code, notes, and snippets.

@xtetsuji
Last active April 28, 2016 03:29
Show Gist options
  • Save xtetsuji/cd3515428f378ace3fb9e140c9e218f1 to your computer and use it in GitHub Desktop.
Save xtetsuji/cd3515428f378ace3fb9e140c9e218f1 to your computer and use it in GitHub Desktop.
Time::HiRes::ualarm micro-second argument is signed 32 bit integer.
$ perl -MTime::HiRes=ualarm -E 'ualarm(3600 * 10**6);'
Time::HiRes::ualarm(-694967296, 0): negative time not invented yet at -e line 1.
$ perl -MTime::HiRes=ualarm -E 'ualarm(360 * 10**6);'
$ perl -MTime::HiRes=ualarm -E 'say(log(3600 * 10**6)/log(2));'
31.7453497605412
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment