Prefer Process.clock_gettime over Time.now.

This commit is contained in:
Guo Xiang Tan 2018-10-05 10:25:52 +08:00
parent 2bdc36bd8c
commit 77c293f82d

View File

@ -182,7 +182,7 @@ task 'assets:precompile' => 'assets:precompile:before' do
STDERR.puts "Skipping: #{file} already compressed" STDERR.puts "Skipping: #{file} already compressed"
else else
proc.call do proc.call do
start = Time.now start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
STDERR.puts "#{start} Compressing: #{file}" STDERR.puts "#{start} Compressing: #{file}"
# We can specify some files to never minify # We can specify some files to never minify
@ -196,7 +196,7 @@ task 'assets:precompile' => 'assets:precompile:before' do
gzip(path) gzip(path)
brotli(path) brotli(path)
STDERR.puts "Done compressing #{file} : #{(Time.now - start).round(2)} secs" STDERR.puts "Done compressing #{file} : #{(Process.clock_gettime(Process::CLOCK_MONOTONIC) - start).round(2)} secs"
STDERR.puts STDERR.puts
end end
end end