mirror of
https://github.com/polybar/polybar.git
synced 2024-11-18 13:55:11 -05:00
29 lines
399 B
C++
29 lines
399 B
C++
|
#pragma once
|
||
|
|
||
|
#include <chrono>
|
||
|
|
||
|
#include "modules/meta/base.hpp"
|
||
|
|
||
|
POLYBAR_NS
|
||
|
|
||
|
namespace chrono = std::chrono;
|
||
|
|
||
|
namespace modules {
|
||
|
using interval_t = chrono::duration<double>;
|
||
|
|
||
|
template <class Impl>
|
||
|
class timer_module : public module<Impl> {
|
||
|
public:
|
||
|
using module<Impl>::module;
|
||
|
|
||
|
void start();
|
||
|
|
||
|
protected:
|
||
|
interval_t m_interval{1};
|
||
|
|
||
|
void runner();
|
||
|
};
|
||
|
}
|
||
|
|
||
|
POLYBAR_NS_END
|