1 /*=============================================================================
2     Copyright (c) 2001-2010 Joel de Guzman
3 
4     Distributed under the Boost Software License, Version 1.0. (See accompanying
5     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
7 #include "measure.hpp"
8 
9 namespace
10 {
11     struct f : test::base
12     {
benchmark__anon68dcd0eb0111::f13         void benchmark()
14         {
15             this->val += 5; // Here is where you put code that you want
16                             // to benchmark. Make sure it returns something.
17                             // Anything.
18         }
19     };
20 }
21 
main()22 int main()
23 {
24     BOOST_SPIRIT_TEST_BENCHMARK(
25         10000000,   // This is the maximum repetitions to execute
26         (f)         // Place your tests here. For now, we have only one test: (f)
27                     // If you have 3 tests a, b and c, this line will contain (a)(b)(c)
28     )
29 
30     // This is ultimately responsible for preventing all the test code
31     // from being optimized away.  Change this to return 0 and you
32     // unplug the whole test's life support system.
33     return test::live_code != 0;
34 }
35 
36