-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
52 lines (43 loc) · 892 Bytes
/
main.cpp
File metadata and controls
52 lines (43 loc) · 892 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
41
42
43
44
45
46
47
48
49
50
51
52
/**
* @Author: pkalbers
* @Date: 2017-06-21T23:06:32+01:00
* @Last modified by: pkalbers
* @Last modified time: 2017-06-21T23:55:21+01:00
*/
#include <chrono>
#include <iostream>
#include <thread>
#include "progress.hpp"
int main(int argc, char const *argv[])
{
Progress p1(1000);
for (size_t i = 0; i < 1000; ++i)
{
++p1;
std::this_thread::sleep_for(std::chrono::milliseconds(30));
}
p1.finish();
Progress p2(1000);
p2.show_prefix("Process");
for (size_t i = 0; i < 1000; ++i)
{
++p2;
std::this_thread::sleep_for(std::chrono::milliseconds(30));
}
p2.finish();
Progress p3;
for (size_t i = 0; i < 1000; ++i)
{
++p3;
std::this_thread::sleep_for(std::chrono::milliseconds(30));
}
p3.finish();
Progress p4(1e6);
for (size_t i = 0; i < 1e6; ++i)
{
++p4;
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
p4.finish();
return 0;
}