|
|
- #include "lfhmap.hpp"
- #include <string>
- #include <iostream>
- #include <chrono>
-
- int main() {
- size_t v = 13;
- auto map = new mct20::lfhmap<size_t, size_t, 80000>();
- for(int a = 0; a < 250000; a++) {
- map->set(v, v);
- const size_t& t = map->get(v).value();
- if(t != v)
- return 1;
- v*=121;
- v+=17;
- }
- v = 13;
- auto start = std::chrono::high_resolution_clock::now();
- for(int a = 0; a < 250000; a++) {
- const size_t& t = map->get(v).value();
- if(t != v)
- return 1;
- v*=121;
- v+=17;
- }
- auto time = std::chrono::high_resolution_clock::now() - start;
- std::cout << "Test 03 took " << std::chrono::duration_cast<std::chrono::milliseconds>(time).count() << "ms" << std::endl;
- std::cout << "Per 1R " << std::chrono::duration_cast<std::chrono::nanoseconds>(time).count()/250000 << "ns" << std::endl;
- return 0;
- }
|