[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
time() Get Current System Time as Long Integer
#include <time.h> Required for declarations only
long time(timeptr);
long *timeptr; Storage location for time
time() returns the number of seconds that have elapsed since 00:00:00
Greenwich mean time, January 1, 1970. That value is stored in a
location pointed to by 'timeptr'. If 'timeptr' is NULL, the return
value is not stored.
Returns: The time elapsed in seconds. There is no error return.
-------------------------------- Example ---------------------------------
The following statements get and print the elapsed time in seconds.
#include <time.h>
#include <stdio.h>
long elapstime;
main()
{
time(&elapstime);
printf("Number of seconds since 1-1-70: %ld \n",elapstime);
}
See Also:
asctime()
gmtime()
localtime()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson