summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1991-04-04 10:49:03 (GMT)
committerGuido van Rossum <guido@python.org>1991-04-04 10:49:03 (GMT)
commit6590d4a250f804999b8d2e1453afffac268818c6 (patch)
treed2d4667ea16dfce1cd83fdf9c81f573dbbf43845 /Modules
parentdaa8bb334d77f6d25a4b6dfb1c02f11423011e50 (diff)
downloadcpython-6590d4a250f804999b8d2e1453afffac268818c6.zip
cpython-6590d4a250f804999b8d2e1453afffac268818c6.tar.gz
cpython-6590d4a250f804999b8d2e1453afffac268818c6.tar.bz2
Hack for THINK C time function.
Made more functions externally visible.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/timemodule.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index 765c40a..b98e140 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -48,11 +48,19 @@ time_time(self, args)
object *self;
object *args;
{
- long secs;
+ time_t secs;
if (!getnoarg(args))
return NULL;
secs = time((time_t *)NULL);
- return newintobject(secs);
+#ifdef THINK_C
+#ifndef THINK_C_3_0
+/* Difference in origin between Mac and Unix clocks: */
+#define TIMEDIFF ((time_t) \
+ (((1970-1904)*365L + (1970-1904)/4) * 24 * 3600))
+ secs -= TIMEDIFF;
+#endif
+#endif
+ return newintobject((long)secs);
}
static jmp_buf sleep_intr;
@@ -164,7 +172,6 @@ inittime()
#define MacTicks (* (long *)0x16A)
-static
sleep(msecs)
int msecs;
{
@@ -177,7 +184,6 @@ sleep(msecs)
}
}
-static
millisleep(msecs)
long msecs;
{
@@ -190,7 +196,7 @@ millisleep(msecs)
}
}
-static long
+long
millitimer()
{
return MacTicks * 50 / 3; /* MacTicks * 1000 / 60 */