-
Notifications
You must be signed in to change notification settings - Fork 33
/
test.cpp
62 lines (52 loc) · 1.21 KB
/
test.cpp
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
53
54
55
56
57
58
59
60
61
62
#include "tqdm.h"
int main() {
int N = 2000;
tqdm bar;
std::cout << "Overhead of loop only:" << std::endl;
for(int i = 0; i < 100000000; i++) {
bar.progress(i, 100000000);
}
bar.finish();
std::cout << "Basic:" << std::endl;
bar.reset();
bar.set_theme_basic();
for(int i = 0; i < N; i++) {
bar.progress(i, N);
usleep(1000);
}
bar.finish();
std::cout << "Braille:" << std::endl;
bar.reset();
bar.set_theme_braille();
for(int i = 0; i < N; i++) {
bar.progress(i, N);
usleep(3000);
}
bar.finish();
std::cout << "Line:" << std::endl;
bar.reset();
bar.set_theme_line();
for(int i = 0; i < N; i++) {
bar.progress(i, N);
usleep(3000);
}
bar.finish();
std::cout << "Circles:" << std::endl;
bar.reset();
bar.set_theme_circle();
for(int i = 0; i < N; i++) {
bar.progress(i, N);
usleep(3000);
}
bar.finish();
bar.reset();
std::cout << "Vertical bars:" << std::endl;
bar.reset();
bar.set_theme_vertical();
for(int i = 0; i < N; i++) {
bar.progress(i, N);
usleep(3000);
}
bar.finish();
return 0;
}