showing time

This is a discussion on showing time within the C Programming forums, part of the General Programming Boards category; How can I show time in my program. Example in right bottom of screen I want to show time 1:31 ...

  1. #1
    Registered User Micko's Avatar
    Join Date
    Nov 2003
    Posts
    712

    showing time

    How can I show time in my program.
    Example in right bottom of screen I want to show time
    1:31 PM?
    I assume I'll need to use time.h but how can my clock work during program living?
    Thanks in advance

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,848
    Well you need to read this FAQ to find out how to read the keyboard without stopping your program, and this FAQ entry to find out how to position the text cursor prior to displaying some text.

    Basically, you loop trying to read user input, and once per second/minute, you redisplay the time.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 26
    Last Post: 07-05-2010, 11:43 AM
  2. time program showing time since epoch?
    By cus in forum Linux Programming
    Replies: 5
    Last Post: 01-10-2009, 01:56 PM
  3. Is this really true or it's just science fiction?
    By Nutshell in forum A Brief History of Cprogramming.com
    Replies: 145
    Last Post: 04-09-2002, 07:17 PM
  4. time class
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 12-11-2001, 10:12 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21