#ifndef TIMEOUT_H
#define TIMEOUT_H
-#include <boost/signal.hpp>
+#include <boost/signals2.hpp>
namespace lyx {
/// restart the timer
void restart();
/// signal emitted on timer expiry
- boost::signal<void()> timeout;
+ boost::signals2::signal<void()> timeout;
/// emit the signal
void emit();
/// set the timer type
unsigned int timeout_ms;
};
+// Small Timer class useful for debugging and performance investigation.
+class Timer
+{
+public:
+ ///
+ Timer();
+ ///
+ ~Timer();
+ ///
+ void restart();
+ ///
+ int elapsed() const;
+ ///
+ std::string dateStr(char separator = 0) const;
+ ///
+ std::string timeStr(char separator = 0) const;
+ ///
+ std::string toStr() const;
+ ///
+ static std::string currentToStr();
+private:
+ struct Private;
+ Private * d;
+};
} // namespace lyx