-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtimer_test.cpp
More file actions
40 lines (36 loc) · 840 Bytes
/
timer_test.cpp
File metadata and controls
40 lines (36 loc) · 840 Bytes
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
31
32
33
34
35
36
37
38
39
40
#include "turn_timer.hpp"
#include "timed_output.hpp"
#include "milliseconds_to_string.hpp"
#include <fcppt/io/cout.hpp>
#include <fcppt/text.hpp>
#include <sge/time/timer.hpp>
#include <sge/time/second.hpp>
int main()
{
fcppt::io::cout
<< FCPPT_TEXT("Starting timer...\n");
insula::turn_timer t(
std::chrono::milliseconds(
20000));
sge::time::timer add_timer(
sge::time::second(5));
while (!t.expired())
{
if (add_timer.update_b())
{
fcppt::io::cout << FCPPT_TEXT("\nAdding some time...\n");
t.add_to_remaining(
std::chrono::milliseconds(1000));
}
fcppt::io::cout
<< FCPPT_TEXT('\r')
<<
insula::milliseconds_to_string(
t.milliseconds_remaining())
<< FCPPT_TEXT('|')
<<
insula::milliseconds_to_string(
t.milliseconds_total());
}
fcppt::io::cout << FCPPT_TEXT("\n");
}