summaryrefslogtreecommitdiff
path: root/src/mmo/timer.hpp
blob: 01b8623d77255b86532ef8157edd830b5032de0b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#ifndef TMWA_MMO_TIMER_HPP
#define TMWA_MMO_TIMER_HPP

# include "timer.t.hpp"

# include "../sanity.hpp"

# include "../strings/fwd.hpp"

// updated automatically when using milli_clock::now()
// which is done only by core.cpp
extern tick_t gettick_cache;

inline
tick_t gettick(void)
{
    return gettick_cache;
}

/// Do all timers scheduled before tick, and return the number of
/// milliseconds until the next timer happens
interval_t do_timer(tick_t tick);

/// Stat a file, and return its modification time, truncated to seconds.
tick_t file_modified(ZString name);

/// Check if there are any events at all scheduled.
bool has_timers();

#endif // TMWA_MMO_TIMER_HPP