-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtimes.h
41 lines (30 loc) · 976 Bytes
/
times.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef _TIMES_H
#define _TIMES_H
#ifdef _WIN32
#include <sys/timeb.h>
#include <sys/types.h>
#include <winsock2.h>
/*
Source for this Code: https://www.codefull.org/2015/12/systime-h-replacement-for-windows/
*/
int gettimeofday(timeval* t, void* timezone);
// from linux's sys/times.h
//#include <features.h>
#define __need_clock_t
#include <time.h>
/* Structure describing CPU time used by a process and its children. */
struct tms
{
clock_t tms_utime; /* User CPU time. */
clock_t tms_stime; /* System CPU time. */
clock_t tms_cutime; /* User CPU time of dead children. */
clock_t tms_cstime; /* System CPU time of dead children. */
};
/* Store the CPU time used by this process and all its
dead children (and their dead children) in BUFFER.
Return the elapsed real time, or (clock_t) -1 for errors.
All times are in CLK_TCKths of a second. */
clock_t times(tms *__buffer);
typedef long long suseconds_t;
#endif
#endif