File: hiclock.h

package info (click to toggle)
libfixmath 0~20220222-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 1,928 kB
  • sloc: ansic: 15,256; python: 88; makefile: 75
file content (33 lines) | stat: -rw-r--r-- 724 bytes parent folder | download
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
#ifndef __hiclock_h__
#define __hiclock_h__

#include <stdint.h>
#include <inttypes.h>

#if defined(__unix__)
#include <sys/time.h>
#define PRIuHICLOCK PRIu64
#define PRIiHICLOCK PRIi64
typedef uint64_t hiclock_t;
#define HICLOCKS_PER_SEC 1000000
#define hiclock_init()
#elif defined(__WIN32) || defined(__WIN64)
#include <windows.h>
#define PRIuHICLOCK PRIu64
#define PRIiHICLOCK PRIi64
typedef LONGLONG hiclock_t;
extern LONGLONG HICLOCKS_PER_SEC;
extern void hiclock_init();
#else
#include <time.h>
#define PRIuHICLOCK PRIu32
#define PRIiHICLOCK PRIi32
typedef clock_t hiclock_t;
#define HICLOCKS_PER_SEC CLOCKS_PER_SEC
#define hiclock_init()
#endif

extern hiclock_t hiclock();

#endif