# This is a patch for Time-HiRes-01.19 to update it to Time-HiRes-01.19
# 
# To apply this patch:
# STEP 1: Chdir to the source directory.
# STEP 2: Run the 'applypatch' program with this patch file as input.
#
# If you do not have 'applypatch', it is part of the 'makepatch' package
# that you can fetch from the Comprehensive Perl Archive Network:
# http://www.perl.com/CPAN/authors/Johan_Vromans/makepatch-x.y.tar.gz
# In the above URL, 'x' should be 2 or higher.
#
# To apply this patch without the use of 'applypatch':
# STEP 1: Chdir to the source directory.
# STEP 2: Run the 'patch' program with this file as input.
#
#### End of Preamble ####

#### Patch data follows ####
diff -up '/usr/tmp/mp10196.d/old/Time-HiRes-01.19/HiRes.pm' 'Time-HiRes-01.19/HiRes.pm'
Index: ./HiRes.pm
Prereq:  1.19 
--- ./HiRes.pm	Tue Sep 29 22:36:58 1998
+++ ./HiRes.pm	Tue Jan 12 09:26:13 1999
@@ -11,7 +11,7 @@ require DynaLoader;
 @EXPORT = qw( );
 @EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday time tv_interval);
 
-$VERSION = do{my@r=q$Revision: 1.19 $=~/\d+/g;sprintf '%02d.'.'%02d'x$#r,@r};
+$VERSION = do{my@r=q$Revision: 1.192 $=~/\d+/g;sprintf '%02d.'.'%02d'x$#r,@r};
 
 bootstrap Time::HiRes $VERSION;
 
diff -up '/usr/tmp/mp10196.d/old/Time-HiRes-01.19/HiRes.xs' 'Time-HiRes-01.19/HiRes.xs'
Index: ./HiRes.xs
Prereq:  1.10 
--- ./HiRes.xs	Tue Sep 29 22:36:58 1998
+++ ./HiRes.xs	Tue Jan 12 09:25:31 1999
@@ -151,11 +151,39 @@ ualarm(int usec, int interval)
 }
 #endif
 
+#ifdef HAS_GETTIMEOFDAY
+
+static void
+myU2time(UV *ret)
+{
+  struct timeval Tp;
+  int status;
+  status = gettimeofday (&Tp, NULL);
+  ret[0] = Tp.tv_sec;
+  ret[1] = Tp.tv_usec;
+}
+
+static double
+myNVtime()
+{
+  struct timeval Tp;
+  int status;
+  status = gettimeofday (&Tp, NULL);
+  return Tp.tv_sec + (Tp.tv_usec / 1000000.);
+}
+
+#endif
 
 MODULE = Time::HiRes            PACKAGE = Time::HiRes
 
 PROTOTYPES: ENABLE
 
+BOOT:
+#ifdef HAS_GETTIMEOFDAY
+  hv_store(PL_modglobal, "Time::NVtime", 12, newSViv((IV) myNVtime), 0);
+  hv_store(PL_modglobal, "Time::U2time", 12, newSViv((IV) myU2time), 0);
+#endif
+
 #ifdef HAS_USLEEP
 
 void
@@ -211,12 +239,8 @@ gettimeofday()
 
 double
 time()
-        PREINIT:
-        struct timeval Tp;
-        CODE:
-	int status;
-        status = gettimeofday (&Tp, NULL);
-        RETVAL = Tp.tv_sec + (Tp.tv_usec / 1000000.);
+	CODE:
+        RETVAL = myNVtime();
 	OUTPUT:
 	RETVAL
 
#### End of Patch data ####

#### ApplyPatch data follows ####
# Data version        : 1.0
# Date generated      : Tue Jan 12 09:28:17 1999
# Generated by        : makepatch 2.00 (2.0BETA)
# Recurse directories : Yes
# p 'HiRes.pm' 6453 916151173 0100644
# p 'HiRes.xs' 5358 916151131 0100644
#### End of ApplyPatch data ####

#### End of Patch kit [created: Tue Jan 12 09:28:17 1999] ####
#### Checksum: 104 2809 12476 ####
