Diffstat (limited to 'mcon/U/d_ftime.U')
1 files changed, 78 insertions, 0 deletions
diff --git a/mcon/U/d_ftime.U b/mcon/U/d_ftime.U
new file mode 100644
@@ -0,0 +1,78 @@
+?RCS: $Id: d_ftime.U,v 3.0 1993/08/18 12:06:06 ram Exp $
+?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS: $Log: d_ftime.U,v $
+?RCS: Revision 3.0 1993/08/18 12:06:06 ram
+?RCS: Baseline for dist 3.0 netwide release.
+?MAKE:d_ftime d_gettimeod: Inlibc Setvar
+?MAKE: -pick add $@ %<
+?S: This variable conditionally defines the HAS_FTIME symbol, which indicates
+?S: that the ftime() routine exists. The ftime() routine is basically
+?S: a sub-second accuracy clock.
+?S: This variable conditionally defines the HAS_GETTIMEOFDAY symbol, which
+?S: indicates that the gettimeofday() system call exists (to obtain a
+?S: sub-second accuracy clock). You should probably include <sys/resource.h>.
+?C: This symbol, if defined, indicates that the ftime() routine exists.
+?C: It is basically a sub-second accuracy clock, but is less accurate
+?C: than gettimeofday(2) anyway. The type "Timeval" should be used to
+?C: refer to "struct timeb".
+?C: This symbol, if defined, indicates that the gettimeofday() system
+?C: call is available for a sub-second accuracy clock. Usually, the file
+?C: <sys/resource.h> needs to be included (see I_SYS_RESOURCE).
+?C: The type "Timeval" should be used to refer to "struct timeval".
+?H:#$d_ftime HAS_FTIME /**/
+?H:#$d_gettimeod HAS_GETTIMEOFDAY /**/
+?H:?%<:#define Timeval struct timeb /* Structure used by ftime() */
+?H:?%<:#define Timeval struct timeval /* Structure used by gettimeofday() */
+?LINT:set d_gettimeod d_ftime
+: see if gettimeofday or ftime exists
+?X: Give priority to gettimeofday(2) because timing is more accurate
+set gettimeofday d_gettimeod
+case "$d_gettimeod" in
+ set ftime d_ftime
+ eval $inlibc
+ val="$undef"; set d_ftime; eval $setvar
+case "$d_gettimeod$d_ftime" in
+ echo " "
+ echo 'No ftime() nor gettimeofday() -- timing may be less accurate.' >&4