timestamp.h
Go to the documentation of this file.
/*
Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
Copyright (C) 2022 The University of Notre Dame
This software is distributed under the GNU General Public License.
See the file COPYING for details.
*/
#ifndef TIMESTAMP_H
#define TIMESTAMP_H
#include "int_sizes.h"
#include <time.h>
typedef UINT64_T timestamp_t;
#define TIMESTAMP_FORMAT UINT64_FORMAT
timestamp_t timestamp_get(void);
int timestamp_fmt(char *buf, size_t size, const char *fmt, timestamp_t ts);
void timestamp_sleep(timestamp_t interval);
time_t timestamp_file(const char *file);
#endif
timestamp_get
timestamp_t timestamp_get(void)
Get the current time.
timestamp_sleep
void timestamp_sleep(timestamp_t interval)
Sleep for a specified time.
timestamp_fmt
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...
timestamp_t
UINT64_T timestamp_t
A type to hold the current time, in microseconds since January 1st, 1970.
Definition timestamp.h:20
timestamp_file
time_t timestamp_file(const char *file)
Get the last modified time of a file.