Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ritcv.UUCP Path: utzoo!linus!philabs!cmcl2!seismo!rochester!ritcv!abh6509 From: abh6509@ritcv.UUCP (A. Hudson) Newsgroups: net.micro.pc Subject: Query: problem with onboard clock use Message-ID: <8959@ritcv.UUCP> Date: Tue, 15-Oct-85 17:42:55 EDT Article-I.D.: ritcv.8959 Posted: Tue Oct 15 17:42:55 1985 Date-Received: Fri, 18-Oct-85 21:01:36 EDT References: <293@tellab3.UUCP> <134@hscfvax.UUCP> <563@uwmcsd1.UUCP> Reply-To: abh6509@ritcv.UUCP (Andrew) Organization: Rochester Institute of Technology, Rochester, NY Lines: 33 In preparation for real-time applications using a standard IBM PC we did some benchmarking of loops. Using an ABSOLUTE call to a supplied machine code routine that reads current system time, precise to hundreths of a second, the time was recorded before and after an empty FOR NEXT loop. 1600 'EMPTY LOOP TIME DELAY 1610 ROUT=0 : CALL ABSOLUTE(H%,M%,S%,T%,ROUT) 1620 FOR I = 1 TO 1000 : NEXT I : ROUT = 0 : CALL ABSOLUTE(HL%,ML%,SL%,TL%,ROUT) 1630 T1 = 3600*(HL%-H%)+60*(ML%-M%)+(SL%-S%)+0.1*(TL%-T%) 1640 LPRINT USING "T=##.### SEC";T1 1650 RETURN FOR T = 10000 FOR T = 1000 T= 6.480 T= 0.660 T= 6.420 T= 0.610 T= 6.430 T= 0.600 T= 6.480 T= 0.660 T= 6.480 T= 0.610 avg(T) = 6.47 avg(T) = 0.627 The results were very disheartening, not only did each loop with the same iteration count vary from test to test, but different iteration counts had different averages! This is using the onboard clock, not the quadboard or calendar/clock board. I suspect interrupts of some sort happening spuradically during the loop. Any diagnosis for this malady, especially with prognosis, would be appreciated. Andrew Hudson ritcv!abh6509