sheet3
This commit is contained in:
parent
56614805cf
commit
2195a9db0a
51 changed files with 13038 additions and 0 deletions
27
sheet3/1/mysecond.c
Normal file
27
sheet3/1/mysecond.c
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
/* A gettimeofday routine to give access to the wall
|
||||
clock timer on most UNIX-like systems.
|
||||
|
||||
This version defines two entry points -- with
|
||||
and without appended underscores, so it *should*
|
||||
automagically link with FORTRAN */
|
||||
|
||||
#include <sys/time.h>
|
||||
|
||||
double mysecond()
|
||||
{
|
||||
/* struct timeval { long tv_sec;
|
||||
long tv_usec; };
|
||||
|
||||
struct timezone { int tz_minuteswest;
|
||||
int tz_dsttime; }; */
|
||||
|
||||
struct timeval tp;
|
||||
struct timezone tzp;
|
||||
int i;
|
||||
|
||||
i = gettimeofday(&tp,&tzp);
|
||||
return ( (double) tp.tv_sec + (double) tp.tv_usec * 1.e-6 );
|
||||
}
|
||||
|
||||
double mysecond_() {return mysecond();}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue