Changeset 2df361 in git


Ignore:
Timestamp:
Oct 12, 2012, 5:28:18 PM (12 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '4188d308699580d975efd0f6cca8dcb41c396f70')
Children:
2a95b234ef67ebbc98057baefb8dd2ed43af3762
Parents:
a25f7a7df8cf584f3b2fa702cf106448e9ceced5
git-author:
Martin Lee <martinlee84@web.de>2012-10-12 17:28:18+02:00
git-committer:
Martin Lee <martinlee84@web.de>2012-10-24 12:26:22+02:00
Message:
chg: made functions and variables for timings static
File:
1 edited

Legend:

Unmodified
Added
Removed
  • factory/timing.h

    ra25f7a7 r2df361  
    4343#if defined(WINNT) && ! defined(__GNUC__)
    4444
    45 #define TIMING_START(t) { clock_t timing_ ## t ## _start, timing_ ## t ## _end; \
    46   timing_ ## t ## _start = clock();
     45#define TIMING_START(t) timing_ ## t ## _start = clock();
    4746#define TIMING_END(t) timing_ ## t ## _end = clock(); \
    48 timing_ ## t ## _time += timing_ ## t ## _end - timing_ ## t ## _start; }
     47timing_ ## t ## _time += timing_ ## t ## _end - timing_ ## t ## _start;
    4948#define TIMING_END_AND_PRINT(t, msg) times( &timing_ ## t ## _end ); \
    5049  fprintf( stderr, "%s%.2f sec\n", msg, \
    5150           float( timing_ ## t ## _end - timing_ ## t ## _start ) / HZ ); \
    52   timing_ ## t ## _time += timing_ ## t ## _end - timing_ ## t ## _start; }
    53 #define TIMING_DEFINE_PRINT(t) clock_t timing_ ## t ## _time; \
    54 void timing_print_ ## t ( char * msg ) { \
     51  timing_ ## t ## _time += timing_ ## t ## _end - timing_ ## t ## _start;
     52#define TIMING_DEFINE_PRINT(t) static clock_t timing_ ## t ## _start, timing_ ## t ## _end; \
     53static clock_t timing_ ## t ## _time; \
     54static void timing_print_ ## t ( char * msg ) { \
    5555  fprintf( stderr, "%s%.2f sec\n", msg, float(timing_ ## t ## _time) / HZ ); \
    5656} \
    57 void timing_reset_ ## t () { \
     57static void timing_reset_ ## t () { \
    5858  timing_ ## t ## _time = 0; \
    5959}
     
    6161#else /* ! WINNT */
    6262
    63 #define TIMING_START(t) { struct tms timing_ ## t ## _start, timing_ ## t ## _end; \
    64   times( &timing_ ## t ## _start );
     63#define TIMING_START(t) times( &timing_ ## t ## _start );
    6564#define TIMING_END(t) times( &timing_ ## t ## _end ); \
    66   timing_ ## t ## _time += timing_ ## t ## _end.tms_utime - timing_ ## t ## _start.tms_utime; }
     65  timing_ ## t ## _time += timing_ ## t ## _end.tms_utime - timing_ ## t ## _start.tms_utime;
    6766#define TIMING_END_AND_PRINT(t, msg) times( &timing_ ## t ## _end ); \
    6867  fprintf( stderr, "%s%.2f sec\n", msg, \
    6968           float( timing_ ## t ## _end.tms_utime - timing_ ## t ## _start.tms_utime ) / HZ ); \
    70   timing_ ## t ## _time += timing_ ## t ## _end.tms_utime - timing_ ## t ## _start.tms_utime; }
    71 #define TIMING_DEFINE_PRINT(t) long timing_ ## t ## _time; \
    72 void timing_print_ ## t ( char * msg ) { \
     69  timing_ ## t ## _time += timing_ ## t ## _end.tms_utime - timing_ ## t ## _start.tms_utime;
     70#define TIMING_DEFINE_PRINT(t) static struct tms timing_ ## t ## _start, timing_ ## t ## _end; \
     71static long timing_ ## t ## _time; \
     72static void timing_print_ ## t ( char * msg ) { \
    7373  fprintf( stderr, "%s%.2f sec\n", msg, float(timing_ ## t ## _time) / HZ ); \
    7474} \
    75 void timing_reset_ ## t () { \
     75static void timing_reset_ ## t () { \
    7676  timing_ ## t ## _time = 0; \
    7777}
Note: See TracChangeset for help on using the changeset viewer.