FastPolyEval  1.0
Fast Evaluation of Real and Complex Polynomials
chrono.h
Go to the documentation of this file.
1 //
2 // chrono.h
3 //
4 // Authors: Nicolae Mihalache & François Vigneron
5 //
6 // This software is released under BSD licence, with an attribution clause (see Licence file).
7 // Please cite the reference below if you use or distribute this software.
8 //
9 // • [1] R. Anton, N. Mihalache & F. Vigneron. Fast evaluation of real and complex polynomials. 2022.
10 // https://hal.archives-ouvertes.fr/hal-03820369
11 //
12 // Copyright 2022 Univ. Paris-Est Créteil & Univ. de Reims Champagne-Ardenne.
13 //
14 
21 #ifndef chrono_h
22 #define chrono_h
23 
24 #include <stdio.h>
25 
26 #include <sys/timeb.h>
27 #include <time.h>
28 
29 #include "ntypes.h"
30 
32 #define BILLION 1000000000L
33 
35 #define MILLION 1000000L
36 
38 #define MINUTE 60000L
39 
41 #define HOUR (60 * MINUTE)
42 
44 #define DAY (24 * HOUR)
45 
47 #define USED_CLOCK CLOCK_MONOTONIC
48 
50 typedef struct timespec ptime;
51 
58 void millis(long ms, char *str);
59 
66 void nanos(long ns, char *str);
67 
79 ulong lap(ptime *ts, char *str);
80 
82 void print_time_res(void);
83 
84 #endif /* chrono_h */
ulong lap(ptime *ts, char *str)
Computes and prints the time lapse since ts.
void nanos(long ns, char *str)
Formats the time duration in nanoseconds ns into human readable string str.
void millis(long ms, char *str)
Formats the time duration in miliseconds ms into human readable string str.
void print_time_res(void)
Prints the timer resolution.
struct timespec ptime
Short type name for precise time.
Definition: chrono.h:50
Definition of basic types.
uint64_t ulong
ulong is uint64
Definition: ntypes.h:37