libtime++: Date and time calculation
timer.c
Go to the documentation of this file.
1
/* this program checks time functions
2
*
3
* ----
4
* libtime is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17
* ----
18
*/
19
#include <sys/types.h>
20
#include <sys/times.h>
21
#include <stdio.h>
22
23
struct
timeb
{
24
time_t
time
;
25
unsigned
short
millitm
;
26
short
timezone
;
27
short
dstflag
;
28
};
29
30
extern
int
ftime
(
struct
timeb
*__tp);
31
32
main
()
33
{
34
struct
timeb
zeit;
35
int
resulter, i,j, k;
36
printf(
"hi there\n"
);
37
for
(i=0;i<20;i++)
38
{
39
resulter=
ftime
(&zeit);
40
printf(
"%d %d %huh %hdh %hdh\n"
,resulter, zeit.
time
, zeit.
millitm
,
41
zeit.
timezone
, zeit.
dstflag
);
42
for
(j=1;j<5000;j++)
43
k=j*50+4/j*j;
44
}
45
}
timeb::timezone
short timezone
Definition:
timer.c:26
timeb::time
time_t time
Definition:
timer.c:24
timeb::millitm
unsigned short millitm
Definition:
timer.c:25
main
main()
Definition:
timer.c:32
timeb
Definition:
timer.c:23
ftime
int ftime(struct timeb *__tp)
timeb::dstflag
short dstflag
Definition:
timer.c:27
tests
timer.c
Generated on Mon Aug 21 2023 17:36:10 for libtime++: Date and time calculation by
1.8.14