]> git.tdb.fi Git - libs/gui.git/commitdiff
Avoid using too much CPU time in the event tester
authorMikko Rasa <tdb@tdb.fi>
Fri, 19 Dec 2014 03:07:10 +0000 (05:07 +0200)
committerMikko Rasa <tdb@tdb.fi>
Fri, 19 Dec 2014 03:07:45 +0000 (05:07 +0200)
examples/ev.cpp

index e164879993a9db3190ac63d747d63df89a6a5efb..8029df2af8310a9c1e5a25a326b8d607bbfba085 100644 (file)
@@ -5,6 +5,8 @@
 #include <msp/io/print.h>
 #include <msp/stringcodec/codec.h>
 #include <msp/stringcodec/utf8.h>
+#include <msp/time/timedelta.h>
+#include <msp/time/utils.h>
 
 using namespace Msp;
 
@@ -48,6 +50,7 @@ Ev::Ev(int, char **):
 void Ev::tick()
 {
        window.tick();
+       Time::sleep(Time::msec);
 }
 
 void Ev::key_press(unsigned key)