delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/06/13/19:45:05

From: "Yury A. Zaitsev" <yurick AT oblik DOT dp DOT ua>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: __djgpp_map_physical_memory - some questions
Date: Wed, 13 Jun 2001 19:56:29 +0300
Organization: Apex NCC Public InterNet News Server
Lines: 15
Message-ID: <tv58g9.vui.ln@nix-if1>
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1010606090422 DOT 14278F AT is> <3c03g9 DOT v17 DOT ln AT nix-if1> <200106112355 DOT TAA12944 AT envy DOT delorie DOT com>
NNTP-Posting-Host: dialup83.apex.dp.ua
X-Trace: main.apex.dp.ua 992473580 83209 195.24.139.83 (13 Jun 2001 23:06:20 GMT)
X-Complaints-To: abuse AT apex DOT dp DOT ua
NNTP-Posting-Date: 13 Jun 2001 23:06:20 GMT
User-Agent: tin/1.5.8-20010221 ("Blue Water") (UNIX) (Linux/2.2.19 (i686))
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Mon, 11 Jun 2001, DJ Delorie <dj AT delorie DOT com> wrote:

>> Is DOS _really_ so slow?
DD> No, but consider that Unix keeps track of the time *as* a time_t, so
DD> time() merely reads a number from memory and returns it - a few CPU
DD> cycles at best.  DOS, however, uses the hardware realtime clock, so it
DD> must convert month/day/year/hour/minute/second/timezone to a time_t
DD> each time you need to know what time it is.  The conversion is slow.
	Well, but why time() simply not caches this values (month/day/year/
hour/minute/second/timezone) (such as Linux kernel does)? If time() will
remember old values of year, month, day and timezone, it will works many 
times faster (it'll needs only to add sec+60*(min+60*hour)).
   I've tested mktime()'s speed just now and yes, you are right.
mktime() is a bottle-neck of the time(). It takes about 70-80% of the 
time()'s time :)

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019