event/Loop: use std::chrono

This commit is contained in:
Max Kellermann
2016-12-27 23:06:34 +01:00
parent 3413d1bf23
commit b042095ac2
22 changed files with 92 additions and 78 deletions

View File

@@ -25,6 +25,7 @@
#include "Compiler.h"
#include <string>
#include <chrono>
struct Partition;
class OutputStream;
@@ -34,7 +35,7 @@ class StateFile final : private TimeoutMonitor {
const AllocatedPath path;
const std::string path_utf8;
const unsigned interval;
const std::chrono::steady_clock::duration interval;
Partition &partition;
@@ -46,9 +47,9 @@ class StateFile final : private TimeoutMonitor {
prev_playlist_version = 0;
public:
static constexpr unsigned DEFAULT_INTERVAL = 2 * 60;
static constexpr std::chrono::steady_clock::duration DEFAULT_INTERVAL = std::chrono::minutes(2);
StateFile(AllocatedPath &&path, unsigned interval,
StateFile(AllocatedPath &&path, std::chrono::steady_clock::duration interval,
Partition &partition, EventLoop &loop);
void Read();