Skip to content

Instantly share code, notes, and snippets.

@niconiconi
Created April 12, 2019 04:52
Show Gist options
  • Save niconiconi/b7492030910e961c686d613d87ffaef3 to your computer and use it in GitHub Desktop.
Save niconiconi/b7492030910e961c686d613d87ffaef3 to your computer and use it in GitHub Desktop.
map
#include <map>
#include <ctime>
#include <cstdlib>
#include <cstdio>
using namespace std;
map<int, int> my_map;
int main()
{
srand(time(0));
clock_t t0 = clock();
const int n = 1000000; //1e6
for(int i = 0; i < n; ++i)
my_map[rand()] = rand();
printf("Time: %f\n", ((float)clock() - t0) / CLOCKS_PER_SEC);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment