Skip to content

Commit

Permalink
#2390: use timing::getCurrentTime() when trace is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
cwschilly committed Jan 14, 2025
1 parent c76a334 commit ed8151f
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/vt/runnable/runnable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,16 @@ void RunnableNew::run() {
{
needs_time = contexts_.lb.needsTime();
}
TimeType start_time = needs_time ? theSched()->getRecentTime() : TimeType{NAN};

auto getTime = [&]() {
#if vt_check_enabled(trace_enabled)
return theTrace() ? timing::getCurrentTime() : theSched()->getRecentTime();
#else
return theSched()->getRecentTime();
#endif
};

TimeType start_time = needs_time ? getTime() : TimeType{NAN};

#if vt_check_enabled(fcontext)
if (suspended_) {
Expand Down Expand Up @@ -175,7 +184,7 @@ void RunnableNew::run() {
#endif
}
theSched()->setRecentTimeToStale();
TimeType end_time = needs_time ? theSched()->getRecentTime() : TimeType{NAN};
TimeType end_time = needs_time ? getTime() : TimeType{NAN};



Expand Down

0 comments on commit ed8151f

Please sign in to comment.