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

@ -32,7 +32,7 @@ fn (mut app App) sse() vweb.Result {
data := '{"time": "$time.now().str()", "random_id": "$rand.ulid()"}'
session.send_message(event: 'ping', data: data) or { return app.server_error(501) }
println('> sent event: $data')
time.sleep_ms(1000)
time.wait(1 * time.second)
}
return app.server_error(501)
}