| 1 |
#[codspeed_divan_compat::bench] |
| 2 |
fn sleep_1ms() { |
| 3 |
std::thread::sleep(std::time::Duration::from_millis(1)); |
| 4 |
} |
| 5 |
|
| 6 |
#[codspeed_divan_compat::bench] |
| 7 |
fn sleep_10ms() { |
| 8 |
std::thread::sleep(std::time::Duration::from_millis(10)); |
| 9 |
} |
| 10 |
|
| 11 |
#[codspeed_divan_compat::bench] |
| 12 |
fn sleep_50ms() { |
| 13 |
std::thread::sleep(std::time::Duration::from_millis(50)); |
| 14 |
} |
| 15 |
|
| 16 |
#[codspeed_divan_compat::bench] |
| 17 |
fn sleep_100ms() { |
| 18 |
std::thread::sleep(std::time::Duration::from_millis(100)); |
| 19 |
} |
| 20 |
|
| 21 |
// Tests COD-1044, do not modify the sample size or count! |
| 22 |
#[codspeed_divan_compat::bench(sample_size = 3, sample_count = 6)] |
| 23 |
fn sleep_100ms_with_custom_sample() { |
| 24 |
std::thread::sleep(std::time::Duration::from_millis(100)); |
| 25 |
} |
| 26 |
|
| 27 |
fn main() { |
| 28 |
codspeed_divan_compat::main(); |
| 29 |
} |