File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
3- require "benchmark"
4-
53module I18nJS
64 class CLI
75 class ExportCommand < Command
@@ -69,7 +67,7 @@ class ExportCommand < Command
6967 )
7068 end
7169
72- time = Benchmark . realtime do
70+ time = benchmark_realtime do
7371 load_require_file! ( require_file ) if require_file
7472 I18nJS . call ( config_file :)
7573 end
@@ -90,6 +88,12 @@ class ExportCommand < Command
9088 options [ :config_file ] ||= config_file if File . file? ( config_file )
9189 options [ :require_file ] ||= require_file if File . file? ( require_file )
9290 end
91+
92+ private def benchmark_realtime
93+ start = Process . clock_gettime ( Process ::CLOCK_MONOTONIC )
94+ yield
95+ Process . clock_gettime ( Process ::CLOCK_MONOTONIC ) - start
96+ end
9397 end
9498 end
9599end
You can’t perform that action at this time.
0 commit comments