🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.mac
Article #19793

LightSpeed C time() function in unix.h

#19793
From: Simon Tortike
Date: Sat, 03 Oct 1987 08:07
25 lines
1983 bytes
I was trying out some timings in LightSpeed C the other day when I ran
into a little problem with the call to time() in the unix library.
Specifically, I was timing adds, multiplications and divisions with
(separately) double and short double variables (i.e. 64-bit and 80-bit)
with a one-line for loop.  time() was called before and after the
for loop in each case.  Output was written using printf. All the integer
variables were declared unsigned long.
 I had the source code, MacTraps, unix.h, stdio.h and PrLink.Lib in one
segment in the project.  The timings for the additions and multiplications
were fine, but the call to time() before the divides seems to cause
a address error (access address 3FFF8003 - instruction - this info. from
TMON).  This occurred whether the loop was 10 times or 1 000 000 times.
I commented out all the code except for the divides (which were last) and
the same error occurred.
  Could anyone say whether I am using the function time() incorrectly
or if this is some other bug which might have been posted previously?
I am using a Mac+ with S4.0/F5.4 and an HD-20.  Probably best to mail
any suggestions to me. (I am only a casual Mac programmer.)
  -------------------  
W. Simon Tortike
Dept Min, Met &    UUCP:   {ubc-vision,ihnp4,mnetor}!alberta!simon
  Petroleum Engg   BITNET: stortike@ualtavm
Univ. of Alberta   AGT:    (403) 432-3338
Edmonton, AB
Canada T6G 2G6
Technical Details
Message-ID: <176@pembina.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!bloom-beacon!think!ames!lll-tis!ptsfa!ihnp4!alberta!simon

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!bloom-beacon!think!ames!lll-tis!ptsfa!ihnp4!alberta!simon
From: simon@alberta.UUCP (Simon Tortike)
Newsgroups: comp.sys.mac
Subject: LightSpeed C time() function in unix.h
Message-ID: <176@pembina.UUCP>
Date: Sat, 3-Oct-87 04:07:02 EDT
Article-I.D.: pembina.176
Posted: Sat Oct  3 04:07:02 1987
Date-Received: Wed, 7-Oct-87 03:12:16 EDT
Organization: U. of Alberta, Edmonton, AB
Lines: 25
Summary: Problem using LSC unix time() with double arithmetic