fixed multibars
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import random
|
||||
import time
|
||||
|
||||
import numpy as np
|
||||
|
||||
import scgenerator as sc
|
||||
|
||||
SIZE = 100
|
||||
@@ -8,11 +10,15 @@ SIZE = 100
|
||||
|
||||
def compute_stuff(num: int, pbar: sc.threading.Multibar):
|
||||
speed = random.random() * 5
|
||||
out = 0
|
||||
for i in pbar(range(SIZE), desc=f"num {num}"):
|
||||
time.sleep(0.05 * speed * random.random())
|
||||
# time.sleep(0.01 * speed * random.random())
|
||||
out += np.abs(np.subtract.outer(np.random.rand(1 << 13), np.random.rand(1 << 13))).min()
|
||||
if i == 32:
|
||||
pbar.print(f"reached 32 in {num}")
|
||||
# if random.random() > 0.98:
|
||||
# print(f"some text {i}")
|
||||
return num
|
||||
return out
|
||||
|
||||
|
||||
def main():
|
||||
|
||||
Reference in New Issue
Block a user