Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120848486
tim.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Jul 7, 12:07
Size
1 KB
Mime Type
text/x-c
Expires
Wed, Jul 9, 12:07 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
27233093
Attached To
R2795 mitgcm_lac_leman_abirani
tim.c
View Options
/*
* $Header: /u/gcmpack/MITgcm/eesupp/src/tim.c,v 1.6 2003/11/11 20:38:26 edhill Exp $
* $Name: $
//BOP
// !ROUTINE: cloc
// !INTERFACE:
cloc( double *curtim )
*/
/* Here, we get the definition of the FC_NAMEMANGLE() macro. */
#include "FC_NAMEMANGLE.h"
#define TIM_USES_GETTIMEOFDAY
/*
// !DESCRIPTION:
// *======================================================*
// | cloc( double* timeinsec)
// *======================================================*
// | Call system time routines and return elapsed time
// | in seconds as a 64-bit float.
// *======================================================*
//EOP
*/
#ifdef TIM_USES_OSF_GETCLOCK
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include <sys/time.h>
void procedure_cloc ( double *curtim )
{
struct timespec tv1;
getclock(TIMEOFDAY, &tv1);
*curtim = (double)((tv1.tv_nsec)+(tv1.tv_sec)*1.E9);
*curtim = *curtim/1E9;
}
#endif
#ifdef TIM_USES_GETTIMEOFDAY
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include <sys/time.h>
void FC_NAMEMANGLE(cloc) ( double *curtim )
{
struct timeval tv1;
gettimeofday(&tv1 , (void *)NULL );
*curtim = (double)((tv1.tv_usec)+(tv1.tv_sec)*1.E6);
*curtim = *curtim/1.E6;
}
#endif
Event Timeline
Log In to Comment