cctools
timestamp.h
Go to the documentation of this file.
1/*
2Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
3Copyright (C) 2022 The University of Notre Dame
4This software is distributed under the GNU General Public License.
5See the file COPYING for details.
6*/
7
8#ifndef TIMESTAMP_H
9#define TIMESTAMP_H
10
15#include "int_sizes.h"
16#include <time.h>
17
20typedef UINT64_T timestamp_t;
21
22#define TIMESTAMP_FORMAT UINT64_FORMAT
23
29
38int timestamp_fmt(char *buf, size_t size, const char *fmt, timestamp_t ts);
39
45
51time_t timestamp_file(const char *file);
52
53#endif
timestamp_t timestamp_get(void)
Get the current time.
void timestamp_sleep(timestamp_t interval)
Sleep for a specified time.
int timestamp_fmt(char *buf, size_t size, const char *fmt, timestamp_t ts)
Formats timestamp_t ts according to the format specification fmt and stores the result as a string in...
UINT64_T timestamp_t
A type to hold the current time, in microseconds since January 1st, 1970.
Definition timestamp.h:20
time_t timestamp_file(const char *file)
Get the last modified time of a file.