File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed
crates/divan_compat/examples Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,10 @@ harness = false
29
29
name = " time"
30
30
harness = false
31
31
32
+ [[bench ]]
33
+ name = " time_scale"
34
+ harness = false
35
+
32
36
[[bench ]]
33
37
name = " the_algorithms"
34
38
harness = false
Original file line number Diff line number Diff line change
1
+ fn main ( ) {
2
+ divan:: main ( ) ;
3
+ }
4
+
5
+ #[ divan:: bench]
6
+ fn sleep_1ns ( ) {
7
+ std:: thread:: sleep ( std:: time:: Duration :: from_nanos ( 1 ) ) ;
8
+ }
9
+
10
+ #[ divan:: bench]
11
+ fn sleep_100ns ( ) {
12
+ std:: thread:: sleep ( std:: time:: Duration :: from_nanos ( 100 ) ) ;
13
+ }
14
+
15
+ #[ divan:: bench]
16
+ fn sleep_1us ( ) {
17
+ std:: thread:: sleep ( std:: time:: Duration :: from_micros ( 1 ) ) ;
18
+ }
19
+
20
+ #[ divan:: bench]
21
+ fn sleep_100us ( ) {
22
+ std:: thread:: sleep ( std:: time:: Duration :: from_micros ( 100 ) ) ;
23
+ }
24
+
25
+ #[ divan:: bench]
26
+ fn sleep_1ms ( ) {
27
+ std:: thread:: sleep ( std:: time:: Duration :: from_millis ( 1 ) ) ;
28
+ }
You can’t perform that action at this time.
0 commit comments