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"
else
proc.call do
start = Time.now
start = Process.clock_gettime(Process::CLOCK_MONOTONIC)
STDERR.puts "#{start} Compressing: #{file}"
# We can specify some files to never minify
@ -196,7 +196,7 @@ task 'assets:precompile' => 'assets:precompile:before' do
gzip(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
end
end