Tools made in assistance of the Metacall Project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
688 B

преди 3 години
  1. #include "lfhmap.hpp"
  2. #include <string>
  3. #include <iostream>
  4. #include <chrono>
  5. int main() {
  6. size_t v = 13;
  7. auto map = new mct20::lfhmap<size_t, size_t, 80000>();
  8. auto start = std::chrono::high_resolution_clock::now();
  9. for(int a = 0; a < 250000; a++) {
  10. map->set(v, v);
  11. const size_t& t = map->get(v).value();
  12. if(t != v)
  13. return 1;
  14. v*=121;
  15. v+=17;
  16. }
  17. auto time = std::chrono::high_resolution_clock::now() - start;
  18. std::cout << "Test 02 took " << std::chrono::duration_cast<std::chrono::milliseconds>(time).count() << "ms" << std::endl;
  19. std::cout << "Per 1R1W " << std::chrono::duration_cast<std::chrono::nanoseconds>(time).count()/250000 << "ns" << std::endl;
  20. return 0;
  21. }