fixed multibars

This commit is contained in:
2024-02-15 15:58:31 +01:00
parent 866f8cd2ff
commit a0d597723c
4 changed files with 37 additions and 10 deletions

View File

@@ -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():