[ion] Sharing millis & micros for blackbox and simulator

This commit is contained in:
Damien Nicolet
2018-11-08 23:54:11 +01:00
parent bc8d9746c8
commit f93bf97182
13 changed files with 33 additions and 49 deletions

View File

@@ -116,19 +116,3 @@ void Ion::msleep(long ms) {
}
}
}
static auto start = std::chrono::high_resolution_clock::now();
uint32_t Ion::millis() {
sDisplay->redraw();
Fl::wait(0);
auto elapsed = std::chrono::high_resolution_clock::now() - start;
return std::chrono::duration_cast<std::chrono::milliseconds>(elapsed).count();
}
uint32_t Ion::micros() {
sDisplay->redraw();
Fl::wait(0);
auto elapsed = std::chrono::high_resolution_clock::now() - start;
return std::chrono::duration_cast<std::chrono::microseconds>(elapsed).count();
}