mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
time: consolidate the different sleep functions into time.wait(Duration) (#8853)
This commit is contained in:
@@ -15,7 +15,7 @@ struct App {
|
||||
}
|
||||
|
||||
fn exit_after_timeout(timeout_in_ms int) {
|
||||
time.sleep_ms(timeout_in_ms)
|
||||
time.wait(timeout_in_ms * time.millisecond)
|
||||
// eprintln('webserver is exiting ...')
|
||||
exit(0)
|
||||
}
|
||||
@@ -105,6 +105,6 @@ pub fn (mut app App) shutdown() vweb.Result {
|
||||
|
||||
fn (mut app App) gracefull_exit() {
|
||||
eprintln('>> webserver: gracefull_exit')
|
||||
time.sleep_ms(100)
|
||||
time.wait(100 * time.millisecond)
|
||||
exit(0)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user