COIN-OR::LEMON - Graph Library

source: lemon-0.x/test/time_measure_test.cc @ 1956:a055123339d5

Last change on this file since 1956:a055123339d5 was 1956:a055123339d5, checked in by Alpar Juttner, 14 years ago

Unified copyright notices

File size: 1.1 KB
Line 
1/* -*- C++ -*-
2 *
3 * This file is a part of LEMON, a generic C++ optimization library
4 *
5 * Copyright (C) 2003-2006
6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
7 * (Egervary Research Group on Combinatorial Optimization, EGRES).
8 *
9 * Permission to use, modify and distribute this software is granted
10 * provided that this copyright notice appears in all copies. For
11 * precise terms see the accompanying LICENSE file.
12 *
13 * This software is provided "AS IS" with no warranty of any kind,
14 * express or implied, and with no claim as to its suitability for any
15 * purpose.
16 *
17 */
18
19#include <lemon/time_measure.h>
20
21///\file \brief Test cases for time_measure.h
22///
23///\todo To be extended
24
25
26using namespace lemon;
27
28void f()
29{
30  double d=0;
31  for(int i=0;i<10000;i++)
32    d+=0.1;
33}
34
35int main()
36{
37  Timer T;
38  int n;
39  for(n=0;T.realTime()<1.0;n++) ;
40  std::cout << T << " (" << n << " time queries)\n";
41  T.restart();
42  while(T.realTime()<2.0) ;
43  std::cout << T << '\n';
44  TimeStamp full;
45  TimeStamp t=runningTimeTest(f,1,&n,&full);
46  std::cout << t << " (" << n << " tests)\n";
47  std::cout << "Total: " << full << "\n";
48 
49  return 0;
50}
Note: See TracBrowser for help on using the repository browser.