Skip to content

Commit

Permalink
Remove debug print statments in release versions
Browse files Browse the repository at this point in the history
  • Loading branch information
C0D3-M4513R committed Apr 4, 2022
1 parent 3efc18b commit 652d09a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "time"
version = "0.1.1"
version = "0.1.2"
edition = "2021"
publish = false

Expand Down
2 changes: 2 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,14 @@ It will be used for this program, to write the current system time to.
}
times += 1;
let dur_subsec_millis = local.subsec_millis();
#[cfg(debug_assertions)]
if dur_subsec_millis as u128 + s.elapsed().as_millis() > 100 && times > 10 {
panic!(
"Something went wrong. We wrote {}ms after the second changed.",
dur_subsec_millis as u128 + s.elapsed().as_millis()
);
}
#[cfg(debug_assertions)]
println!(
"{}ms slow, processing & writing took {}ns",
dur_subsec_millis,
Expand Down

0 comments on commit 652d09a

Please sign in to comment.