PIObject::deleteLater important fix

PIWaitEvent::sleep() method
PITimer thread imp wait optimization, migrate to interruptable sleeps
This commit is contained in:
2022-11-10 12:26:08 +03:00
parent d9eac06749
commit 398d760ba9
6 changed files with 58 additions and 9 deletions

View File

@@ -3,6 +3,7 @@
#include "pibytearray.h"
#include "pimathbase.h"
#include "pijson.h"
#include "piwaitevent_p.h"
using namespace PICoutManipulators;
@@ -88,6 +89,21 @@ void phase(const char * msg) {
int main(int argc, char * argv[]) {
piCout << "main";
PITimer timer;
timer.setSlot([](){
static int cnt = 0;
piCout << "tick" << ++cnt;
});
timer.start(500);
piSleep(1.12);
piCout << "end";
PITimeMeasurer tm;
timer.stop();
double tm_ms = tm.elapsed_m();
piCout << "stop took" << tm_ms;
return 0;
/*for (int i = 0; i < count; ++i)
pipes[i].create();