2 #include<lemon/random.h>
3 #include<lemon/time_measure.h>
39 inline void f_random()
45 inline void f_drand48()
56 inline void f_rnd_int1000()
61 inline void f_rnd_bool()
79 const double TEST_DURATION=10;
81 t=runningTimeTest(f_no,2,&n,&full);
83 t=runningTimeTest(f_no,TEST_DURATION,&n,&full);
84 std::cout << "EMPTY: ";
85 std::cout << t.userTime() << " (" << n << " tests)\n";
87 t=runningTimeTest(f_noi,TEST_DURATION,&n,&full);
88 std::cout << "INLINED EMPTY: ";
89 std::cout << t.userTime() << " (" << n << " tests)\n";
91 TimeStamp ti=t=runningTimeTest(f_i,TEST_DURATION,&n,&full);
92 std::cout << "INT COPY: ";
93 std::cout << t.userTime() << " (" << n << " tests)\n";
95 TimeStamp tl=t=runningTimeTest(f_l,TEST_DURATION,&n,&full);
96 std::cout << "LONG COPY: ";
97 std::cout << t.userTime() << " (" << n << " tests)\n";
99 TimeStamp td=t=runningTimeTest(f_d,TEST_DURATION,&n,&full);
100 std::cout << "DOUBLE COPY: ";
101 std::cout << t.userTime() << " (" << n << " tests)\n";
103 t=runningTimeTest(f_rand,TEST_DURATION,&n,&full);
104 std::cout << "rand(): ";
105 std::cout << (t-ti).userTime() << " (" << n << " tests)\n";
107 t=runningTimeTest(f_random,TEST_DURATION,&n,&full);
108 std::cout << "random(): ";
109 std::cout << (t-tl).userTime() << " (" << n << " tests)\n";
111 t=runningTimeTest(f_drand48,TEST_DURATION,&n,&full);
112 std::cout << "drand48(): ";
113 std::cout << (t-td).userTime() << " (" << n << " tests)\n";
115 t=runningTimeTest(f_rnd_d,TEST_DURATION,&n,&full);
116 std::cout << "rnd(): ";
117 std::cout << (t-td).userTime() << " (" << n << " tests)\n";
119 t=runningTimeTest(f_rnd_int1000,TEST_DURATION,&n,&full);
120 std::cout << "rnd[1000]: ";
121 std::cout << (t-ti).userTime() << " (" << n << " tests)\n";
123 t=runningTimeTest(f_rnd_bool,TEST_DURATION,&n,&full);
124 std::cout << "rnd.boolean(): ";
125 std::cout << (t-ti).userTime() << " (" << n << " tests)\n";
127 // t=runningTimeTest(f_,TEST_DURATION,&n,&full);
128 // std::cout << "\n";
129 // std::cout << t << " (" << n << " tests)\n";
130 // std::cout << "Total: " << full << "\n\n";