added a dedicated sleep function

This commit is contained in:
deadvey
2026-04-01 18:27:39 +01:00
parent a912836c07
commit aff8a8dd43
4 changed files with 19 additions and 6 deletions

View File

@@ -1,4 +1,11 @@
import random
import time
# Random number generator that's biased towards 0
def biased_random(max_value, strength=3):
return round((random.random() ** strength) * max_value)
def sleep(wpm):
sleep_time = (1/(wpm/60))-1
if sleep_time > 0.0:
time.sleep(sleep_time)