Added timing logging to start/stop display, not just timed exposure

This commit is contained in:
Matt McWilliams 2024-05-14 20:23:09 -04:00
parent 8d6e1a8f67
commit 58f0d17779
1 changed files with 5 additions and 1 deletions

View File

@ -60,6 +60,7 @@ void actionDisplay () {
displaying = true;
completed = true;
timing = false;
startTime = steady_clock::now();
} else if (exposure.size() == 1) {
exposureTime = exposure[0];
displaying = true;
@ -72,6 +73,9 @@ void actionDisplay () {
void actionStop () {
displaying = false;
completed = true;
auto currentTime = steady_clock::now();
auto elapsedTime = duration_cast<milliseconds>(currentTime - startTime).count();
cout << "{ \"exposed\" : " << elapsedTime << ", \"exposure\" : null }" << endl;
}
void postAction () {
@ -163,7 +167,7 @@ void display () {
if (displaying && timing) {
auto currentTime = steady_clock::now();
auto elapsedTime = duration_cast<milliseconds>(currentTime - startTime).count();
if (elapsedTime > exposureTime) {
if (elapsedTime >= exposureTime) {
cout << "{ \"exposed\" : " << elapsedTime << ", \"exposure\" : " << exposureTime << " }" << endl;
displaying = false;
timing = false;