Last active
August 29, 2015 14:06
-
-
Save technion/7759443b328d4bc7dc1e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$more xortime.rb | |
#!/usr/bin/env ruby | |
#technion@lolware.net | |
require 'absolute_time' | |
ITER = 100000000 | |
i = 1 | |
puts AbsoluteTime.realtime { | |
(ITER).times do | |
i = i ^ 49 | |
end | |
} | |
i = 'a' | |
puts AbsoluteTime.realtime { | |
(ITER).times do | |
i = (i.ord ^ 'b'.ord).chr | |
end | |
} | |
$ ./xortime.rb | |
13.805093835107982 | |
52.14712872263044 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment