From 3dfaa2aedde4fb76b54db93e8f5ed209286b1a70 Mon Sep 17 00:00:00 2001 From: Elizabeth Mattijsen Date: Sun, 29 Oct 2017 12:51:51 +0100 Subject: [PATCH] Make sure we actually record since start of program Instead of number of microseconds since epoch. --- src/core/Telemetry.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/Telemetry.pm b/src/core/Telemetry.pm index cd1552ea24c..d53cbe7b75d 100644 --- a/src/core/Telemetry.pm +++ b/src/core/Telemetry.pm @@ -7,6 +7,8 @@ class Telemetry { has int $!cpu-sys; has int $!wallclock; + my num $start = Rakudo::Internals.INITTIME; + multi method new(Telemetry:) { nqp::create(self).SET-SELF } method SET-SELF() { @@ -15,7 +17,7 @@ class Telemetry { + nqp::atpos_i(rusage, nqp::const::RUSAGE_UTIME_MSEC); $!cpu-sys = nqp::atpos_i(rusage, nqp::const::RUSAGE_STIME_SEC) * 1000000 + nqp::atpos_i(rusage, nqp::const::RUSAGE_STIME_MSEC); - $!wallclock = nqp::fromnum_I(1000000 * nqp::time_n,Int); + $!wallclock = nqp::fromnum_I(1000000*nqp::sub_n(nqp::time_n,$start),Int); self }