/[MITgcm]/MITgcm/eesupp/src/tim.c
ViewVC logotype

Diff of /MITgcm/eesupp/src/tim.c

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

revision 1.2 by cnh, Tue Sep 29 21:22:33 1998 UTC revision 1.3 by cnh, Wed Oct 28 03:11:35 1998 UTC
# Line 1  Line 1 
1  #include <mpi.h>  #define FORTRAN_MANGLE_TRAILING_UNDERSCORE
2    #define TIM_USES_GETTIMEOFDAY
3    
4    #define procedure_cloc cloc
5    #ifdef FORTRAN_MANGLE_TRAILING_UNDERSCORE
6    #define procedure_cloc cloc_
7    #endif
8    #ifdef TIM_USES_OSF_GETCLOCK
9  #include <stdio.h>  #include <stdio.h>
10  #include <stdlib.h>  #include <stdlib.h>
11  #include <unistd.h>  #include <unistd.h>
12  #include <assert.h>  #include <assert.h>
13  #include <sys/time.h>  #include <sys/time.h>
14  void cloc_( double *curtim )  void procedure_cloc ( double *curtim )
15  {  {
16   struct timespec tv1;   struct timespec tv1;
17   getclock(TIMEOFDAY, &tv1);   getclock(TIMEOFDAY, &tv1);
18   *curtim =  (double)((tv1.tv_nsec)+(tv1.tv_sec)*1.E9);   *curtim =  (double)((tv1.tv_nsec)+(tv1.tv_sec)*1.E9);
19   *curtim = *curtim/1E9;   *curtim = *curtim/1E9;
20  }  }
21    #endif
22    #ifdef TIM_USES_GETTIMEOFDAY
23    #include <stdio.h>
24    #include <stdlib.h>
25    #include <unistd.h>
26    #include <assert.h>
27    #include <sys/time.h>
28    void procedure_cloc ( double *curtim )
29    {
30     struct timeval tv1;
31     gettimeofday(&tv1 , (void *)NULL );
32     *curtim =  (double)((tv1.tv_usec)+(tv1.tv_sec)*1.E6);
33     *curtim = *curtim/1.E6;
34    
35    }
36    #endif
37    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.22