summaryrefslogtreecommitdiff
path: root/tests/thread/stress_create.py
diff options
context:
space:
mode:
authorJim Mussared <jim.mussared@gmail.com>2022-08-18 16:57:45 +1000
committerJim Mussared <jim.mussared@gmail.com>2023-06-08 17:54:24 +1000
commit4216bc7d1351feb8199e4ebbff1a9598aa1c5b02 (patch)
tree5085738ef65ab377c221f290c7fa90ec2acd4d29 /tests/thread/stress_create.py
parent5e50975a6dd9466afafbcd012c00078093fe1f57 (diff)
tests: Replace umodule with module everywhere.
This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
Diffstat (limited to 'tests/thread/stress_create.py')
-rw-r--r--tests/thread/stress_create.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/thread/stress_create.py b/tests/thread/stress_create.py
index 877424cdf..98f272f5c 100644
--- a/tests/thread/stress_create.py
+++ b/tests/thread/stress_create.py
@@ -1,13 +1,12 @@
# stress test for creating many threads
-try:
- import utime
-
- sleep_ms = utime.sleep_ms
-except ImportError:
- import time
+import time
+if hasattr(time, "sleep_ms"):
+ sleep_ms = time.sleep_ms
+else:
sleep_ms = lambda t: time.sleep(t / 1000)
+
import _thread