Commit 0b6a2ed 1 parent 1f39c26 commit 0b6a2ed Copy full SHA for 0b6a2ed
File tree 3 files changed +8
-10
lines changed
3 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -41,6 +41,7 @@ serde_json = "1"
41
41
42
42
[target .'cfg(target_arch = "wasm32")' .dev-dependencies ]
43
43
criterion = { version = " 0.5" , default-features = false }
44
+ getrandom = { version = " 0.2" , features = [" js" ] }
44
45
wasm-bindgen-test = " 0.3"
45
46
46
47
[features ]
Original file line number Diff line number Diff line change 69
69
extern "C" {
70
70
fn unix_time_milliseconds_imported ( ) -> u64 ;
71
71
}
72
- let start_time = unsafe {
73
- unix_time_milliseconds_imported ( )
74
- } ;
72
+ let start_time = unsafe { unix_time_milliseconds_imported ( ) } ;
75
73
let result = f ( ) ;
76
- let end_time = unsafe {
77
- unix_time_milliseconds_imported ( )
78
- } ;
74
+ let end_time = unsafe { unix_time_milliseconds_imported ( ) } ;
79
75
80
76
let duration = std:: time:: Duration :: from_millis ( end_time - start_time) ;
81
77
( result, duration)
Original file line number Diff line number Diff line change @@ -92,12 +92,13 @@ lazy_static! {
92
92
extern "C" {
93
93
fn unix_time_milliseconds_imported( ) -> u64 ;
94
94
}
95
- let unix_millis = unsafe {
96
- unix_time_milliseconds_imported( )
97
- } ;
95
+ let unix_millis = unsafe { unix_time_milliseconds_imported( ) } ;
98
96
99
97
use chrono:: Datelike ;
100
- chrono:: DateTime :: <chrono:: Utc >:: from( std:: time:: SystemTime :: UNIX_EPOCH + std:: time:: Duration :: from_millis( unix_millis) ) . year( )
98
+ chrono:: DateTime :: <chrono:: Utc >:: from(
99
+ std:: time:: SystemTime :: UNIX_EPOCH + std:: time:: Duration :: from_millis( unix_millis) ,
100
+ )
101
+ . year( )
101
102
} ;
102
103
}
103
104
You can’t perform that action at this time.
0 commit comments