From 7972d253ab3b7f1eb11383bf4e0c4958c4ad6606 Mon Sep 17 00:00:00 2001 From: flamingcow Date: Sat, 11 May 2019 20:24:48 -0700 Subject: [PATCH] User/system time percentages --- usage.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usage.cc b/usage.cc index 1100aa9..3acd725 100644 --- a/usage.cc +++ b/usage.cc @@ -50,8 +50,8 @@ void UsageTracker::Log() { VLOG(1) << "usage:"; VLOG(1) << "\t events: " << std::setw(19) << std::setfill(' ') << events_; VLOG(1) << "\t wall time: " << std::setw(19) << std::setfill(' ') << wall_time_.count() << "ns"; - VLOG(1) << "\t user time: " << std::setw(19) << std::setfill(' ') << user_time_.count() << "ns"; - VLOG(1) << "\t sys time: " << std::setw(19) << std::setfill(' ') << sys_time_.count() << "ns"; + VLOG(1) << "\t user time: " << std::setw(19) << std::setfill(' ') << user_time_.count() << "ns (" << ((user_time_ * 100) / (user_time_ + sys_time_)) << "%)"; + VLOG(1) << "\t sys time: " << std::setw(19) << std::setfill(' ') << sys_time_.count() << "ns (" << ((sys_time_ * 100) / (user_time_ + sys_time_)) << "%)"; VLOG(1) << "\t vol ctxt sw: " << std::setw(19) << std::setfill(' ') << vol_ctxt_sw_; VLOG(1) << "\t invol ctxt sw: " << std::setw(19) << std::setfill(' ') << invol_ctxt_sw_; if (events_) {