PIObject::deleteLater important fix
PIWaitEvent::sleep() method PITimer thread imp wait optimization, migrate to interruptable sleeps
This commit is contained in:
16
main.cpp
16
main.cpp
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user