Skip to main content

Timeline for Optimizing a `while` loop

Current License: CC BY-SA 4.0

6 events
when toggle format what by license comment
Sep 27, 2019 at 17:00 history edited Gilles 'SO- stop being evil' CC BY-SA 4.0
gpio wfi has been implemented (thanks CodenameLambda)
Sep 27, 2019 at 16:25 comment added CodenameLambda Update: There is such a wait command: gpio wfi 0 rising would wait for a rising edge on pin zero, which is non-busy (according to the wiring pi site).
Aug 11, 2013 at 23:38 vote accept Fadi Hanna AL-Kass
Jul 17, 2013 at 8:26 comment added user43216 @Bob: While portability likely doesn't matter in this case, sleep(1)'s acceptance of a fractional number of seconds is non-standard.
Jul 17, 2013 at 4:10 comment added Bob For your last example, you could sleep for a fraction of a second. Something like 0.1 or maybe 0.2 should be able to detect very short presses and still leave plenty of CPU time for other threads.
Jul 17, 2013 at 1:12 history answered Gilles 'SO- stop being evil' CC BY-SA 3.0