From 77c293f82d9397dfbdfdec6122348fac2525d62f Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 5 Oct 2018 10:25:52 +0800 Subject: [PATCH] Prefer `Process.clock_gettime` over `Time.now`. --- lib/tasks/assets.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/assets.rake b/lib/tasks/assets.rake index aa1dcadf82..8575ca11dc 100644 --- a/lib/tasks/assets.rake +++ b/lib/tasks/assets.rake @@ -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