-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
51 lines (44 loc) · 1.49 KB
/
Copy pathmain.cpp
File metadata and controls
51 lines (44 loc) · 1.49 KB
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
#include <iostream>
#include "src/function.hpp"
#include "src/random.hpp"
#include "../timer/timer.hpp"
int main(){
std::string input = strRand(1000000);
int counter = 100;
stopwatch::Stopwatch timer;
// timer.start();
// for (int i = 0; i < counter ; i++){
// remove_ctrl(input);
// }
// printf("time elapse %ld \n", timer.elapsed<stopwatch::nanoseconds>()/10);
timer.start();
for (int i = 0; i < counter ; i++){
remove_ctrl_mutating(input);
}
printf("time elapse %ld \n", timer.elapsed<stopwatch::nanoseconds>()/counter);
timer.start();
for (int i = 0; i < counter ; i++){
remove_ctrl_reserve(input);
}
printf("time elapse %ld \n", timer.elapsed<stopwatch::nanoseconds>()/counter);
timer.start();
for (int i = 0; i < counter ; i++){
remove_ctrl_ref_args(input);
}
printf("time elapse %ld \n", timer.elapsed<stopwatch::nanoseconds>()/counter);
timer.start();
for (int i = 0; i < counter ; i++){
remove_ctrl_ref_args_it(input);
}
printf("time elapse %ld \n", timer.elapsed<stopwatch::nanoseconds>()/counter);
timer.start();
for (int i = 0; i < counter ; i++){
remove_ctrl_block(input);
}
printf("time elapse %ld \n", timer.elapsed<stopwatch::nanoseconds>()/counter);
timer.start();
for (int i = 0; i < counter ; i++){
remove_ctrl_block_append(input);
}
printf("time elapse %ld \n", timer.elapsed<stopwatch::nanoseconds>()/counter);
}