About 97,000 results
Open links in new tab
  1. python - How do I make a time delay? - Stack Overflow

    If you use Tkinter, do not use time.sleep(), because it will muck up your program. This happened to me. Instead, use root.after() and replace the values for however many seconds, with a …

  2. How do I get my program to sleep for 50 milliseconds?

    Nov 1, 2024 · The second way doesn't import the whole module, but it just sleep. from time import sleep # Just the sleep function from module time print("0.00 sec") sleep(0.05) # Don't put time. …

  3. How accurate is python's time.sleep ()? - Stack Overflow

    A high-precision variation of time.sleep(). Logic: time.sleep() has poor precision < 5ms, so given a time window (e.g. 1 second) it splits the remaining time into remaining_time / 2, cutting the …

  4. time - Display a countdown for the python sleep function - Stack …

    time.sleep() may return earlier if the sleep is interrupted by a signal or later (depends on the scheduling of other processes/threads by OS/the interpreter). To improve accuracy over …

  5. python - tkinter and time.sleep - Stack Overflow

    You can emulate time.sleep in tkinter. For this we still need to use the .after method to run our code alongside the mainloop, but we could add readability to our code with a sleep function.

  6. How to stub time.sleep () in Python unit testing - Stack Overflow

    import time from unittest import TestCase from unittest.mock import patch class TestMyCase(TestCase): @patch('time.sleep', return_value=None) def test_my_method(self, …

  7. python - time.sleep -- sleeps thread or process? - Stack Overflow

    Sep 18, 2008 · akki, More specifically, time.sleep() blocks the thread that called time.sleep(), but it releases the Python GIL to run other threads (so it doesn't block the process). Nick's example …

  8. What's the most efficient way to sleep in Python?

    Jul 5, 2016 · time.sleep(delayTime) Action: Suspend execution of the current thread for the given number of seconds. Any caught signal will terminate the sleep() following execution of that …

  9. break/interrupt a time.sleep() in python - Stack Overflow

    Mar 3, 2011 · I need to break from time.sleep() using ctrl c. While 1: time.sleep(60) In the above code when the control enters time.sleep function an entire 60 seconds needs to elapsed for …

  10. python - How to sleep until a specific time YYYY-MM-DD …

    I have been thinking to do a sleep function where it sleeps until a certain date is called. My idea was based of date such as : 2019-01-20 12:00:00. I haven't really figured out how to start to …

Refresh