mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Nit: round delays to 0.1 second.
This commit is contained in:
parent
edca74a627
commit
c864ad695f
1 changed files with 2 additions and 2 deletions
|
@ -21,7 +21,7 @@ def task(ident):
|
|||
delay = whrandom.random() * numtasks
|
||||
whmutex.release()
|
||||
if verbose:
|
||||
print 'task', ident, 'will run for', delay, 'sec'
|
||||
print 'task', ident, 'will run for', round(delay, 1), 'sec'
|
||||
time.sleep(delay)
|
||||
if verbose:
|
||||
print 'task', ident, 'done'
|
||||
|
@ -89,7 +89,7 @@ def task2(ident):
|
|||
delay = whrandom.random() * numtasks
|
||||
whmutex.release()
|
||||
if verbose:
|
||||
print 'task', ident, 'will run for', delay, 'sec'
|
||||
print 'task', ident, 'will run for', round(delay, 1), 'sec'
|
||||
time.sleep(delay)
|
||||
if verbose:
|
||||
print 'task', ident, 'entering barrier', i
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue