diff options
Diffstat (limited to 'tests/thread/stress_heap.py')
-rw-r--r-- | tests/thread/stress_heap.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/thread/stress_heap.py b/tests/thread/stress_heap.py index ac3ebe0491..5482a9ac6f 100644 --- a/tests/thread/stress_heap.py +++ b/tests/thread/stress_heap.py @@ -3,6 +3,10 @@ # # MIT license; Copyright (c) 2016 Damien P. George on behalf of Pycom Ltd +try: + import utime as time +except ImportError: + import time import _thread def last(l): @@ -37,6 +41,6 @@ n_finished = 0 for i in range(n_thread): _thread.start_new_thread(thread_entry, (10000,)) -# busy wait for threads to finish +# wait for threads to finish while n_finished < n_thread: - pass + time.sleep(1) |