-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvector_time_test.cpp
More file actions
40 lines (32 loc) · 916 Bytes
/
vector_time_test.cpp
File metadata and controls
40 lines (32 loc) · 916 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
//
// Created by Santiago Bashir on 8/6/21.
//
#include "vector.hpp"
#include <vector>
#define NAMESP ft
static void time() {
for (int i = 0; i < 10000; i++) {
NAMESP::vector<int> sample;
for (int j = 0; j < 1000; j++)
sample.push_back(j);
NAMESP::vector<int> isample(sample);
for (int j = 0; j < 1000; j++)
sample.pop_back();
sample.assign(isample.begin(), isample.end());
for (int j = 0; j < 1000; j++) {
sample.erase(sample.begin(), sample.end());
}
for (int j = 0; j < 1000; j++) {
isample.resize(j);
isample.reserve(43);
}
NAMESP::vector<int> ksample(1000, 42);
for (int j = 0; j < 10; j++) {
isample.insert(isample.begin(), ksample.begin(), ksample.end());
}
}
}
int main() {
time();
return 0;
}