On Tue, 3 Feb 2004, sathyashrayan wrote:
Friends,
As I was going through the standard draft of C (C99) I come across
the header file <time.h>. I wonder why the standard has included the
header file since it depends on the hardware that we work with. If
somebody wants to access the time of the system then he has to use the
interrupt 1A in the real mode or access the timer chip (port id
70-70h) pmode but that is off-topic in this group.
I concluded that it is because of the running-time analysis that is
needed for a program.
(Correct me if I am wrong)
Consider yourself corrected. The time.h header files is there because
there is a standard set of functions associated with time and clocks. This
is nothing new to the C standard.
If the standard can include a *portable* way of accessing a hardware
why not the standard include for other routines also such as keyboard,
graphic device drivers, hard disk etc.
If I take a moment and think about it, I am hard pressed to thing of a
system that does not have some sort of clock or timer on it. The standard
has allowed for systems that don't have a clock but I believe the norm is
for a system to have a clock.
I'm looking at four development systems on my desk that have no keyboard,
no graphics and no hard drive support. Many of the systems I work with are
like this. When I do a printf the standard output is to a memory buffer
and a signal pin to let the host computer know there is data in the C I/O
buffer ready for retrieval. My development environment retrieves the data
from the target computer and displays it on the host computer.
I have no need for graphic drivers or hard drive support. There is an
entire world of development out there that is very different from Windows,
UNIX and MacOS.
NOTE: there are libraries, like curses, that are supported by many
platforms. They attempt to do for displays what time.h does for
clocks/timers.
--
Send e-mail to: darrell at cs dot toronto dot edu
Don't send e-mail to
vi************@whitehouse.gov