How to know calculate the execution time of an algorithm in c++?

后端 未结 4 990
轻奢々
轻奢々 2021-01-07 15:25

I want to test which data structure is the best by looking at the run-time performance of my algorithm, how do I do it?

For example I already have a hashmap<

4条回答
  •  不思量自难忘°
    2021-01-07 16:01

    You would adjust the program to perform thousands or millions of hashmap lookups, ideally chosen randomly, and time that.

提交回复
热议问题