Skip to content

Commit

Permalink
distinguish between “start” and “stop” during in-flight output
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-ferdinand committed Nov 23, 2022
1 parent b87ed26 commit 471b56f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions triton-profiler/src/triton_profiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ impl TritonProfiler {
self.stack.is_empty(),
"Cannot generate report before stack is empty."
);
assert!(
self.total_time != Duration::ZERO,
assert_ne!(
Duration::ZERO,
self.total_time,
"Cannot generate report before profiler has finished. Call `finish()` first."
);

Expand Down Expand Up @@ -175,7 +176,7 @@ impl TritonProfiler {
});

if std::env::var(GET_PROFILE_OUTPUT_AS_YOU_GO_ENV_VAR_NAME).is_ok() {
println!("stop: {name}; took {now:.2?}");
println!("start: {name}");
}
}

Expand Down Expand Up @@ -231,7 +232,7 @@ impl TritonProfiler {
self.profile[index].time = duration;

if std::env::var(GET_PROFILE_OUTPUT_AS_YOU_GO_ENV_VAR_NAME).is_ok() {
println!("stop: {name}");
println!("stop: {name} – took {duration:.2?}");
}
}

Expand Down

1 comment on commit 471b56f

@Sword-Smith
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Please sign in to comment.