Skip to content

Commit

Permalink
Add a non-literal scope that is static typed
Browse files Browse the repository at this point in the history
  • Loading branch information
aclysma committed Oct 14, 2024
1 parent e1ba29b commit c0962e5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions profiling/examples/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ fn some_other_function(iterations: usize) {
profiling::scope!("some_other_function");
burn_time(5);

// Make this a non-literal to touch more of the API
//let scope_str = "do iterations";//.to_string();
//let scope_str_ref = scope_str;
{
profiling::scope!("do iterations");
// Make this a non-literal to touch more of the API. It still has to be 'static scope though
// for multiple of the backends
let scope_name = "do_iterations";
profiling::scope!(scope_name);
for i in 0..iterations {
profiling::scope!(
"some_inner_function_that_sleeps",
Expand Down

0 comments on commit c0962e5

Please sign in to comment.