commit | author | age
|
e8c910
|
1 |
#include "bom.hpp" |
16b655
|
2 |
#include "book.hpp" |
JG |
3 |
#include "json.hpp" |
|
4 |
#include "protocol.hpp" |
|
5 |
#include <chrono> |
e8c910
|
6 |
#include <iostream> |
4fdb65
|
7 |
#include <unistd.h> |
JG |
8 |
#include <unordered_map> |
16b655
|
9 |
|
f99dcd
|
10 |
constexpr int trials = 1000000; |
JG |
11 |
|
16b655
|
12 |
int main(void) |
JG |
13 |
{ |
f99dcd
|
14 |
std::chrono::nanoseconds time(0); |
JG |
15 |
for (int i = 0; i < trials; i++) |
|
16 |
{ |
|
17 |
auto s = std::chrono::high_resolution_clock::now(); |
|
18 |
book::Book b = book::testBook(100, false); |
|
19 |
auto e = std::chrono::high_resolution_clock::now(); |
|
20 |
time += e - s; |
|
21 |
} |
|
22 |
std::cout << time.count() / trials << std::endl; |
|
23 |
// auto bs = protocol::recoverBook(); |
e8c910
|
24 |
// protocol::catchUp(bs); |
f99dcd
|
25 |
// std::cout << bs.size() << std::endl; |
JG |
26 |
// for (auto i : bs) { |
|
27 |
// std::cout << i.first << std::endl; |
|
28 |
// i.second.printBook(); |
|
29 |
// } |
|
30 |
// bom::initialise(); |
|
31 |
// bom::updateBom(bs); |
|
32 |
// bom::destroy(); |
|
33 |
// protocol::catchUp(bs); |
|
34 |
// std::cout << bs.size() << std::endl; |
|
35 |
// for (auto& i : bs) { |
|
36 |
// std::cout << i.first << ", " << i.second.expiry.count() << ", " << i.second.bomPrice << std::endl; |
|
37 |
// i.second.printBook(); |
|
38 |
// } |
16b655
|
39 |
} |