Python Forum
CPU usage with while Loop and LIRC [SOLVED]
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CPU usage with while Loop and LIRC [SOLVED]
#4
It's common to put a small sleep() in there for programs that are meant to run for very long periods of time, that way it doesn't eat the processor's time when it really doesn't need to. For example, at the end of your while loop, add a time.sleep(0.01).
Reply


Messages In This Thread
RE: CPU usage with while Loop and LIRC - by IAMK - Apr-08-2018, 08:02 PM
RE: CPU usage with while Loop and LIRC [SOLVED] - by nilamo - Apr-09-2018, 08:10 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [SOLVED] Loop through directories and files one level down? Winfried 3 2,255 Apr-28-2024, 02:31 PM
Last Post: Gribouillis
  [SOLVED] [loop] Exclude ranges in… range? Winfried 2 3,848 May-14-2023, 04:29 PM
Last Post: Winfried
  Loop through json file and reset values [SOLVED] AlphaInc 2 5,403 Apr-06-2023, 11:15 AM
Last Post: AlphaInc
  [SOLVED] [Linux] Script in cron stops after first run in loop Winfried 2 1,577 Nov-16-2022, 07:58 PM
Last Post: Winfried
  [SOLVED] [BS] Why new tag only added at the end when defined outside the loop? Winfried 1 1,507 Sep-05-2022, 09:36 AM
Last Post: snippsat
  Loop through list of ip-addresses [SOLVED] AlphaInc 7 6,527 May-11-2022, 02:23 PM
Last Post: menator01

Forum Jump:

User Panel Messages

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