-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework sig processing threads and add perf for process/verify
- Loading branch information
Showing
5 changed files
with
128 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,3 +68,4 @@ libc = "^0.2.1" | |
getopts = "^0.2" | ||
isatty = "0.1" | ||
futures = "0.1" | ||
rand = "0.4.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
use std::time::{SystemTime, UNIX_EPOCH}; | ||
use std::time::Duration; | ||
|
||
pub fn duration_as_ms(d: &Duration) -> u64 { | ||
return (d.as_secs() * 1000) + (d.subsec_nanos() as u64 / 1_000_000); | ||
} | ||
|
||
pub fn duration_as_s(d: &Duration) -> f32 { | ||
return d.as_secs() as f32 + (d.subsec_nanos() as f32 / 1_000_000_000.0); | ||
} | ||
|
||
pub fn timestamp() -> u64 { | ||
let now = SystemTime::now().duration_since(UNIX_EPOCH).unwrap(); | ||
return duration_as_ms(&now); | ||
} |