Removed double NAME entry.
[AROS.git] / compiler / clib / time.c
blobb7f6fab152de3c52426a89b8a45e4619741a0897
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Return the current time in seconds.
6 */
8 #include <sys/time.h>
10 /*****************************************************************************
12 NAME */
13 #include <time.h>
15 time_t time (
17 /* SYNOPSIS */
18 time_t * tloc)
20 /* FUNCTION
21 time() returns the time since 00:00:00 GMT, January 1, 1970,
22 measured in seconds.
24 INPUTS
25 tloc - If this pointer is non-NULL, then the time is written into
26 this variable as well.
28 RESULT
29 The number of seconds.
31 NOTES
32 This function must not be used in a shared library or
33 in a threaded application.
35 EXAMPLE
36 time_t tt1, tt2;
38 // tt1 and tt2 are the same
39 tt1 = time (&tt2);
41 // This is valid, too
42 tt1 = time (NULL);
44 BUGS
46 SEE ALSO
47 ctime(), asctime(), localtime()
49 INTERNALS
51 ******************************************************************************/
53 struct timeval tv;
54 gettimeofday(&tv, NULL);
55 if (tloc)
56 *tloc = tv.tv_sec;
57 return tv.tv_sec;
58 } /* time */