/[ascend]/trunk/ascend/general/tm_time.c
ViewVC logotype

Diff of /trunk/ascend/general/tm_time.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2018 by jpye, Wed Apr 29 03:38:10 2009 UTC revision 2050 by jpye, Mon Jun 15 07:17:22 2009 UTC
# Line 38  double tm_cpu_time(void) Line 38  double tm_cpu_time(void)
38  {  {
39     static clock_t ref;     static clock_t ref;
40     static double dref;     static double dref;
    static double dcps;  
41     clock_t now;     clock_t now;
42     double dnow;     double dnow;
43    
44     if( f_first ) {     if( f_first ) {
       dcps = (double) CLOCKS_PER_SEC;  
45        ref = clock();        ref = clock();
46        dref = (double) ref;        dref = (double) ref;
47        f_first = FALSE;        f_first = FALSE;
# Line 51  double tm_cpu_time(void) Line 49  double tm_cpu_time(void)
49     now = clock();     now = clock();
50     dnow = (double) now;     dnow = (double) now;
51    
52     return( (dnow - dref)/dcps );     return((dnow - dref)/CLOCKS_PER_SEC);
53  }  }
54    
55  double tm_reset_cpu_time(void)  double tm_reset_cpu_time(void)

Legend:
Removed from v.2018  
changed lines
  Added in v.2050

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22