time.h

This is a discussion on time.h within the C Programming forums, part of the General Programming Boards category; Just a quick question. I want to add a start and stop time to my program. I know that i ...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    17

    Smile time.h

    Just a quick question. I want to add a start and stop time
    to my program. I know that i need to include time.h, but I
    just cannot find what the (c) syntax would be.

    Also, with ms visual c++ compiler, when the output prints
    within the little black box on the screen, is there a easy
    way I can control the amount of data that spins by. I cannot
    backup the screen to see what has gone by.
    Thanks,

    -Rick

  2. #2
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    I know that i need to include time.h, but I
    just cannot find what the (c) syntax would be.
    Thats what help files are for. Also maybe read a few more posts here as something very similar to this has been answered already on this page of threads.
    Also, with ms visual c++ compiler, when the output prints
    within the little black box on the screen, is there a easy
    way I can control the amount of data that spins by. I cannot
    backup the screen to see what has gone by.
    You as the programmer control whats on the screen so just print a screenful of data then ask for an input to see the next page etc.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  3. #3
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,699
    One easy way to limit output is to append "getch();" to the end of each print command. If you're printing in a loop that looks like:
    Code:
    for(i=0;i<whatever;i++)
    {
    printf( "Array Data: %i \n",array[i] ); 
    getch();
    }
    That is an example of printing the contents of an array, line by line.

    If you want to print a page at a time, try two loops:
    Code:
    for(i=0;i<total_lines_divided_by_lines_per_page;i++)
    {
    for(j=0;j<lines_per_page;j++)
    printf( "Array Data: %i \n",array[i] ); 
    }
    getch();
    }
    Code:
    bool fun(bool value)
    {
        return std::pow(std::exp(1), std::complex<float>(0, 1) 
        * std::complex<float>(std::atan(1)*(1 << (value + 2))))
        .real() > 0;
    }

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    17
    Thanks...this is what I was looking for.......
    Thanks,

    -Rick

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. time.h
    By zensatori in forum C Programming
    Replies: 28
    Last Post: 04-15-2007, 06:39 PM
  2. Help with time.h functions please.
    By Ifurita. in forum C++ Programming
    Replies: 4
    Last Post: 05-20-2003, 03:58 AM
  3. time.h and miliseconds question
    By Diamonds in forum C++ Programming
    Replies: 10
    Last Post: 12-16-2002, 07:41 AM
  4. Replies: 2
    Last Post: 10-18-2002, 08:30 AM
  5. a time.h problem
    By Max in forum C Programming
    Replies: 14
    Last Post: 10-15-2002, 02:43 PM

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