1
0
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:
zakuro
2021-02-22 00:05:03 +09:00
committed by GitHub
parent b1209aac1b
commit ac4791045f
49 changed files with 156 additions and 179 deletions

View File

@@ -50,7 +50,7 @@ fn test_a_simple_vweb_app_runs_in_the_background() {
res := os.system(server_exec_cmd)
assert res == 0
}
time.sleep_ms(100)
time.wait(100 * time.millisecond)
}
// web client tests follow
@@ -238,7 +238,7 @@ fn simple_tcp_client(config SimpleTcpClientConfig) ?string {
if tries > config.retries {
return error(err)
}
time.sleep_ms(100)
time.wait(100 * time.millisecond)
continue
}
break

View File

@@ -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)
}