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:
@ -12,14 +12,14 @@ pub struct IResult {
|
||||
fn worker_s(p &pool.PoolProcessor, idx int, worker_id int) &SResult {
|
||||
item := p.get_item<string>(idx)
|
||||
println('worker_s worker_id: $worker_id | idx: $idx | item: $item')
|
||||
time.sleep_ms(3)
|
||||
time.wait(3 * time.millisecond)
|
||||
return &SResult{'$item $item'}
|
||||
}
|
||||
|
||||
fn worker_i(p &pool.PoolProcessor, idx int, worker_id int) &IResult {
|
||||
item := p.get_item<int>(idx)
|
||||
println('worker_i worker_id: $worker_id | idx: $idx | item: $item')
|
||||
time.sleep_ms(5)
|
||||
time.wait(5 * time.millisecond)
|
||||
return &IResult{item * 1000}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user