www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/02/28/05:16:33

Date: Wed, 28 Feb 1996 12:05:56 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Erik Luijten <erik AT tntnhb3 DOT tn DOT tudelft DOT nl>
Cc: djgpp <djgpp AT delorie DOT com>
Subject: Re: time measurement in protected mode?
In-Reply-To: <9602280849.AA20596@tntnhb3.tn.tudelft.nl>
Message-Id: <Pine.SUN.3.91.960228114506.11954C-100000@is>
Mime-Version: 1.0

On Wed, 28 Feb 1996, Erik Luijten wrote:

> I have written a program in which I have to keep track of the time spent
> in various subroutines. On my workstation this works fine, but if I do this
> in a DJGPP-compiled version on a PC, the timing routine considerably slows
> down the program. I understand that this is caused by the switch from protected
> to real mode. Is there any way to do a time measurement without this switch?
> Or does it necessarily involve some BIOS function and hence a switch?

You'll have to provide more details to get meaningful answers to your 
question.  If you only want to time various functions, you can simply 
compile it with -pg switch and use `gprof' to generate a report after 
the program exits.  If this is a feature that you must use while the 
program runs, please tell to what accuracy do you need to measure time.

> A related question: at first I used biostime(), but this function restarts at
> midnight. Now I'm using clock(), but I have no idea whether this function
> will wrap around as well? If so, I wonder whether this occurs at the same time

It is enough to time for 24 hours without wrapping around (but it measures
relative to the time the program started, so it will wrap about 24 hours
after the program started, not at midnight).  For larger time periods
(really, for anything that lasts as long as a few hours), you should use
the `gettimeofday' library function. 

> Finally (this may be a faq, but I couldn't find it): I really like the
> go32=topline feature of v1. Is there something similar in v2, or is this
> impossible because the DPMI host now takes care of many things? In that case,
> would it be possible to include such a function is CWSDPMI?

There is no such feature currently in DJGPP.  Even it will be included, 
it will be only possible for CWSDPMI.  Many people use other DPMI 
servers, where it is impossible at all.

- Raw text -


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