2 % (c) The GRASP/AQUA Project, Glasgow University, 1995
4 \subsection[getClockTime.lc]{getClockTime Runtime Support}
7 #define NON_POSIX_SOURCE /* gettimeofday */
14 # ifdef HAVE_SYS_TIMERS_H
16 # include <sys/timers.h>
20 # ifdef HAVE_GETTIMEOFDAY
22 # ifdef HAVE_SYS_TIME_H
23 # include <sys/time.h>
36 getClockTime(sec, nsec)
43 if (getclock(TIMEOFDAY, &tp) != 0) {
48 ((unsigned long int *)sec)[0] = tp.tv_sec;
49 ((unsigned long int *)nsec)[0] = tp.tv_nsec;
52 #ifdef HAVE_GETTIMEOFDAY
55 if (gettimeofday(&tp, NULL) != 0) {
60 ((unsigned long int *)sec)[0] = tp.tv_sec;
61 ((unsigned long int *)nsec)[0] = tp.tv_usec * 1000;
65 if ((t = time(NULL)) == (time_t) -1) {
70 ((unsigned long int *)sec)[0] = t;
71 ((unsigned long int *)nsec)[0] = 0;