Back to home page

darwin3

 
 

    


File indexing completed on 2024-12-17 18:31:07 UTC

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
4c563c2ee9 Chri*0001 /*
                0002 //BOP
                0003 // !ROUTINE: cloc
                0004 // !INTERFACE:
                0005    cloc(  double *curtim )
                0006 */
e51ecc3fef Ed H*0007 
                0008 /*  Here, we get the definition of the FC_NAMEMANGLE() macro. */
                0009 #include "FC_NAMEMANGLE.h"
                0010 
46dc4f419b Chri*0011 #define TIM_USES_GETTIMEOFDAY
                0012 
4c563c2ee9 Chri*0013 /*
                0014 // !DESCRIPTION:
                0015 // *======================================================*
                0016 // | cloc( double* timeinsec)                                                
                0017 // *======================================================*
                0018 // | Call system time routines and return elapsed time 
                0019 // | in seconds as a 64-bit float.
                0020 // *======================================================*
                0021 //EOP
                0022 */
46dc4f419b Chri*0023 #ifdef TIM_USES_OSF_GETCLOCK
2043ea88e2 Chri*0024 #include <stdio.h>
                0025 #include <stdlib.h>
                0026 #include <unistd.h>
                0027 #include <assert.h>
                0028 #include <sys/time.h>
46dc4f419b Chri*0029 void procedure_cloc ( double *curtim )
2043ea88e2 Chri*0030 {
                0031  struct timespec tv1;
                0032  getclock(TIMEOFDAY, &tv1);
                0033  *curtim =  (double)((tv1.tv_nsec)+(tv1.tv_sec)*1.E9);
                0034  *curtim = *curtim/1E9;
                0035 }
46dc4f419b Chri*0036 #endif
                0037 #ifdef TIM_USES_GETTIMEOFDAY
                0038 #include <stdio.h>
                0039 #include <stdlib.h>
                0040 #include <unistd.h>
                0041 #include <assert.h>
                0042 #include <sys/time.h>
e51ecc3fef Ed H*0043 void FC_NAMEMANGLE(cloc) ( double *curtim )
46dc4f419b Chri*0044 {
                0045  struct timeval tv1;
                0046  gettimeofday(&tv1 , (void *)NULL );
                0047  *curtim =  (double)((tv1.tv_usec)+(tv1.tv_sec)*1.E6);
                0048  *curtim = *curtim/1.E6;
                0049  
                0050 }
                0051 #endif
2043ea88e2 Chri*0052