• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2013-2014 Kyle Lutz <kyle.r.lutz@gmail.com>
3 //
4 // Distributed under the Boost Software License, Version 1.0
5 // See accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt
7 //
8 // See http://boostorg.github.com/compute for more information.
9 //---------------------------------------------------------------------------//
10 
11 #include <algorithm>
12 #include <iostream>
13 
14 #include "perf.hpp"
15 
main(int argc,char * argv[])16 int main(int argc, char *argv[])
17 {
18     perf_parse_args(argc, argv);
19 
20     std::cout << "size: " << PERF_N << std::endl;
21 
22     std::vector<int> v;
23     perf_timer t;
24     for(size_t trial = 0; trial < PERF_TRIALS; trial++){
25         v = generate_random_vector<int>(PERF_N);
26         t.start();
27         std::sort(v.begin(), v.end());
28         t.stop();
29     }
30     std::cout << "time: " << t.min_time() / 1e6 << " ms" << std::endl;
31 
32     return 0;
33 }
34