-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
105 lines (93 loc) · 2.32 KB
/
main.cpp
File metadata and controls
105 lines (93 loc) · 2.32 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#include <iostream>
#include "cava/benchmark/bench.h"
#include <string>
#include <sstream>
#include <charconv>
#include <vector>
#include <iostream>
#include <chrono>
#include <vector>
#include <numeric>
#include <cmath>
#include "cava/System.h"
#include "cava/collections/HashMap.h"
#include "cava/macros/macros.h"
#include "cava/types/integer/Integer.h"
#include "cava/types/object/Object.h"
int main() {
HashMap<Object, Object> map;
map.put("ID_1", 500);
map.put(10, "Deset");
map.put("Aktivni", true);
System::println(map.get("ID_1"));
System::println(map.get(10));
System::println(map.get("Aktivni"));
if (map.containsKey("Neexistuje")) {
System::println("Tohle se nevypise");
}
// benchmark("int assignment", [&]() {
// const int a = 42;
// const int b = a;
// const volatile int c = b;
// (void)c;
// });
//
// benchmark("Integer assignment", [&]() {
// Integer a = 42;
// Integer b = a;
// volatile Integer c = b;
// (void)c;
// });
//
//
// // 2. addition
// benchmark("int addition", [&]() {
// int a = 1;
// for (int i = 0; i < N; ++i) {
// a += i;
// }
// const volatile int x = a;
// (void)x;
// });
//
// benchmark("Integer addition", [&]() {
// Integer a = 1;
// for (int i = 0; i < N; ++i) {
// a += i;
// }
// volatile Integer x = a;
// (void)x;
// });
//
// benchmark("int multiplication", [&]() {
// int a = 2;
// for (int i = 1; i < N; ++i) {
// a = a * i;
// }
// const volatile int x = a;
// (void)x;
// });
//
// benchmark("Integer multiplication", [&]() {
// Integer a = 2;
// for (int i = 1; i < N; ++i) {
// a *= i;
// }
// volatile Integer x = a;
// (void)x;
// });
//
// // 4. to string
// benchmark("int to_string", [&]() {
// const int v = 123456;
// volatile std::string s = std::to_string(v);
// (void)s;
// });
//
// benchmark("Integer toString", [&]() {
// const Integer v = 123456;
// volatile std::string s = v.toString();
// (void)s;
// });
return 0;
}