diff options
Diffstat (limited to 'it.class')
| -rw-r--r-- | it.class | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -115,7 +115,7 @@ static function log_line($name, $line) static function timerlog($label = '') { if ($GLOBALS['debug_timerlog']) - $GLOBALS['ULTRATIMERLOG'] .= sprintf(" %s:%d", $label, (gettimeofday(true) - $GLOBALS['ULTRATIME'])*1000); + $GLOBALS['ULTRATIMERLOG'] .= sprintf(" %s:%d", $label, (hrtime(true) - $GLOBALS['ULTRATIME']) / 1_000_000); } @@ -688,12 +688,12 @@ static function exec($cmd, ...$args) { $args = array_reduce($args, fn($carry, $v) => array_merge($carry, (array)$v), []); # varargs to single array $cmd = it::shell_command($cmd, $args); # NOPHPLINT - $before = gettimeofday(true); + $before = hrtime(true); if ((!($args['_callback'] instanceof Closure) || $args['_callback']($cmd)) && !EDC('noexec')) $result = (string)shell_exec("set +o posix\n" . $cmd); - @it::log('exec', round((gettimeofday(true) - $before)*1000) . "\t$cmd"); + @it::log('exec', round((hrtime(true) - $before) / 1_000_000) . "\t$cmd"); return $result; } @@ -708,13 +708,13 @@ static function system($cmd, ...$args) { $args = array_reduce($args, fn($carry, $v) => array_merge($carry, (array)$v), []); # varargs to single array $cmd = it::shell_command($cmd, $args); # NOPHPLINT - $before = gettimeofday(true); + $before = hrtime(true); $result = 0; if ((!($args['_callback'] instanceof Closure) || $args['_callback']($cmd)) && !EDC('noexec')) system("set +o posix\n" . $cmd, $result); - @it::log('exec', round((gettimeofday(true) - $before)*1000) . "\t$cmd"); + @it::log('exec', round((hrtime(true) - $before) / 1_000_000) . "\t$cmd"); return $result; } |