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:
@@ -4,7 +4,7 @@ import time
|
||||
// Simulate expensive computing using sleep function
|
||||
fn expensive_computing(id int, duration int, mut wg sync.WaitGroup) {
|
||||
println('Executing expensive computing task ($id)...')
|
||||
time.sleep_ms(duration)
|
||||
time.wait(duration * time.millisecond)
|
||||
println('Finish task $id on $duration ms')
|
||||
wg.done()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user