Skip to content

Commit

Permalink
Make sure we actually record since start of program
Browse files Browse the repository at this point in the history
Instead of number of microseconds since epoch.
  • Loading branch information
lizmat committed Oct 29, 2017
1 parent e00f705 commit 3dfaa2a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/Telemetry.pm
Expand Up @@ -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() {
Expand All @@ -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
}

Expand Down

0 comments on commit 3dfaa2a

Please sign in to comment.