21 lines
533 B
C++
21 lines
533 B
C++
// Copyright (2019-2023) Paul Scherrer Institute
|
|
|
|
#ifndef JUNGFRAUJOCH_PREVIEWCOUNTER_H
|
|
#define JUNGFRAUJOCH_PREVIEWCOUNTER_H
|
|
|
|
#include <cstdint>
|
|
#include <mutex>
|
|
#include <chrono>
|
|
|
|
class PreviewCounter {
|
|
mutable std::mutex m;
|
|
std::chrono::microseconds period;
|
|
std::chrono::time_point<std::chrono::system_clock> last_preview;
|
|
public:
|
|
PreviewCounter(std::chrono::microseconds period);
|
|
bool GeneratePreview();
|
|
PreviewCounter& Period(std::chrono::microseconds period);
|
|
};
|
|
|
|
#endif //JUNGFRAUJOCH_PREVIEWCOUNTER_H
|