Python Forum
Assistance with running a few lines of code at an EXACT time
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Assistance with running a few lines of code at an EXACT time
#4
You can expect the time to be accurate if you synchronize with some atomic clock (with some time server) BUT there might be a delay of 0.02 to 0.1 second if you are unlucky. The delay depends on network activities and scheduled computer activities with high priority. Even if you use ns precision these delays can't be calculated by any means. The method that @bowlofred suggests is OK but even sleep(n) is to be considered "sleep at least for n seconds". There might be an unlucky high priority activity scheduled at that precise moment. I wouldn't expect a higher precision than 0.1 sec.
Reply


Messages In This Thread
RE: Assistance with running a few lines of code at an EXACT time - by Serafim - Feb-22-2021, 09:29 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  problem in running a code akbarza 7 813 Feb-14-2024, 02:57 PM
Last Post: snippsat
  writing and running code in vscode without saving it akbarza 1 482 Jan-11-2024, 02:59 PM
Last Post: deanhystad
  the order of running code in a decorator function akbarza 2 617 Nov-10-2023, 08:09 AM
Last Post: akbarza
Question in this code, I input Key_word, it can not find although all data was exact Help me! duchien04x4 3 1,167 Aug-31-2023, 05:36 PM
Last Post: deanhystad
Question Running an action only if time condition is met alexbca 5 1,446 Oct-27-2022, 02:15 PM
Last Post: alexbca
  Code Assistance needed in saving the file MithunT 0 870 Oct-09-2022, 03:50 PM
Last Post: MithunT
  Regular Expression search to comment lines of code Gman2233 5 1,781 Sep-08-2022, 06:57 AM
Last Post: ndc85430
  Code running many times nad not just one? korenron 4 1,454 Jul-24-2022, 08:12 AM
Last Post: korenron
  Error while running code on VSC maiya 4 3,986 Jul-01-2022, 02:51 PM
Last Post: maiya
  code running for more than an hour now, yet didn't get any result, what should I do? aiden 2 1,610 Apr-06-2022, 03:41 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020