cctools
timestamp.h
Go to the documentation of this file.
1 /*
2 Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
3 Copyright (C) 2005- The University of Notre Dame
4 This software is distributed under the GNU General Public License.
5 See 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 
20 typedef UINT64_T timestamp_t;
21 
22 #define TIMESTAMP_FORMAT UINT64_FORMAT
23 
29 
38 int timestamp_fmt(char *buf, size_t size, const char *fmt, timestamp_t ts);
39 
44 void timestamp_sleep(timestamp_t interval);
45 
51 time_t timestamp_file(const char *file);
52 
53 #endif
time_t timestamp_file(const char *file)
Get the last modified time of a file.
timestamp_t timestamp_get(void)
Get the current time.
UINT64_T timestamp_t
A type to hold the current time, in microseconds since January 1st, 1970.
Definition: timestamp.h:20
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...