www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/01/10/15:45:50

From: "DooMWiz" <DooMWiz AT TicNet DOT Com>
Newsgroups: comp.os.msdos.djgpp
Subject: Time_t stuff
Date: Sun, 10 Jan 1999 14:12:14 -0600
Organization: The Internet Connection - ticnet.com (using Airnews.net!)
Lines: 22
Message-ID: <7F82A0A45979CCE2.62B466D22539138C.F9F3FFF8903A0300@library-proxy.airnews.net>
X-Orig-Message-ID: <77b1vr$sa3 AT library DOT airnews DOT net>
Abuse-Reports-To: abuse at ticnet.com to report improper postings
NNTP-Proxy-Relay: library.airnews.net
NNTP-Posting-Time: Sun Jan 10 14:19:08 1999
NNTP-Posting-Host: d,!Co+<VdtBe1BFCh,,>Bl.F%+TMKB (Encoded at Airnews!)
X-Newsreader: Microsoft Outlook Express 4.72.3155.0
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

  Hi.  I want to be able to tell how long a certain file, etc. has been open
or how long a player has been playing, etc. by reading the current time at
startup, then reading the time later on when they quit.  Then just compare
the difference to find how long they were using it.  I've tried using time_t
and the time() function, but I'm having a bit of trouble.  I tried using
this simple program:

int main()
{
  time_t now;
  time(&now);
  printf("Time is %d\n", now);
  delay(2000);
  printf("Time is %d\n", now);
  return 0;
}

But the problem is that after the first time, it prompts you again for the
time.  I really don't know what I should do.  Thanks in advance.



- Raw text -


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