File: timer.h

package info (click to toggle)
raft 0.22.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,504 kB
  • sloc: ansic: 37,539; makefile: 264; sh: 77; python: 22
file content (20 lines) | stat: -rw-r--r-- 364 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Utilities for timing operations. */

#ifndef TIMER_H_
#define TIMER_H_

#include <time.h>

struct timer
{
    struct timespec start;
};

/* Start the current timer. */
void TimerStart(struct timer *timer);

/* Calculate how much time has elapsed since the timer started, in
 * nanosecods. */
unsigned long TimerStop(struct timer *timer);

#endif /* TIMER_H_ */