source: git/libfac/factor/timing.h @ 91b36d

spielwiese
Last change on this file since 91b36d was 91b36d, checked in by Hans Schönemann <hannes@…>, 16 years ago
*hannes: licence stuff git-svn-id: file:///usr/local/Singular/svn/trunk@10750 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.8 KB
Line 
1////////////////////////////////////////////////////////////
2// emacs edit mode for this file is -*- C++ -*-
3// static char * rcsid = "$Id: timing.h,v 1.5 2008-06-10 14:49:16 Singular Exp $";
4////////////////////////////////////////////////////////////
5// It is possible to include this file multiple times for different
6// settings of TIMING (but now this isn't used)
7
8#undef TIMING_START
9#undef TIMING_END
10#undef TIMING_DEFINE_PRINT
11#undef TIMING_DEFINE_PRINTPROTO
12#undef TIMING_PRINT
13
14#ifdef TIMING
15#include <time.h>
16#include <sys/times.h>
17#ifdef HAVE_IOSTREAM
18#include <iostream>
19#define OSTREAM std::ostream
20#define ISTREAM std::istream
21#elif defined(HAVE_IOSTREAM_H)
22#include <iostream.h>
23#define OSTREAM ostream
24#define ISTREAM istream
25#endif
26#define TIMING_START(t) { struct tms timing_ ## t ## _start, timing_ ## t ## _end; \
27  times( &timing_ ## t ## _start );
28#define TIMING_END(t) times( &timing_ ## t ## _end ); \
29  timing_ ## t ## _time += timing_ ## t ## _end.tms_utime - timing_ ## t ## _start.tms_utime; }
30#define TIMING_DEFINE_PRINT(t) long timing_ ## t ## _time; \
31void timing_print_ ## t ( char * msg ) { CERR.setf( ios::fixed, ios::floatfield); CERR.precision(2); \
32  CERR << msg << float(timing_ ## t ## _time) / 60 << " sec" << "\n"; }
33#define TIMING_PRINT(t,msg) timing_print_ ## t ( msg );
34#define TIMING_DEFINE_PRINTPROTO(t) void timing_print_ ## t ( char * );
35#else
36#define TIMING_START(t)
37#define TIMING_END(t)
38#define TIMING_DEFINE_PRINT(t)
39#define TIMING_PRINT(t,msg)
40#define TIMING_DEFINE_PRINTPROTO(t)
41#endif /* TIMING */
42
43/*
44$Log: not supported by cvs2svn $
45Revision 1.4  2006/05/16 14:46:50  Singular
46*hannes: gcc 4.1 fixes
47
48Revision 1.3  1997/09/12 07:19:59  Singular
49* hannes/michael: libfac-0.3.0
50
51Revision 1.2  1997/04/25 22:13:56  michael
52Version for libfac-0.2.1
53
54Revision 1.1  1996/01/17 06:22:05  michael
55Initial revision
56
57*/
Note: See TracBrowser for help on using the repository browser.