Created
November 12, 2018 15:48
-
-
Save fxn/8bd3cbba9e8978d87b82a3c0c744139d 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
require "benchmark/ips" | |
Benchmark.ips do |x| | |
x.report("without TZ") do |n| | |
ENV["TZ"] = nil | |
i = 0 | |
while i < n | |
Time.now | |
i += 1 | |
end | |
end | |
x.report("with TZ") do |n| | |
ENV["TZ"] = ":/etc/localtime" | |
i = 0 | |
while i < n | |
Time.now | |
i += 1 | |
end | |
end | |
x.compare! | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment