~ubuntu-branches/ubuntu/vivid/cctools/vivid

« back to all changes in this revision

Viewing changes to dttools/src/timestamp.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Hanke
  • Date: 2011-05-07 09:05:00 UTC
  • Revision ID: james.westby@ubuntu.com-20110507090500-lqpmdtwndor6e7os
Tags: upstream-3.3.2
ImportĀ upstreamĀ versionĀ 3.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
11
/** @file timestamp.h
 
12
Portable routines for high resolution timing.
 
13
*/
 
14
 
 
15
#include "int_sizes.h"
 
16
#include <time.h>
 
17
 
 
18
/** A type to hold the current time, in microseconds since January 1st, 1970. */
 
19
typedef UINT64_T timestamp_t;
 
20
 
 
21
#define TIMESTAMP_FORMAT UINT64_FORMAT
 
22
 
 
23
/** Get the current time.
 
24
@return The current time, in microseconds since January 1st, 1970.
 
25
*/
 
26
 
 
27
timestamp_t timestamp_get(void);
 
28
 
 
29
/** Sleep for a specified time.
 
30
@param interval The number of microseconds to sleep for.
 
31
*/
 
32
 
 
33
void timestamp_sleep( timestamp_t interval );
 
34
 
 
35
/** Get the last modified time of a file.
 
36
@param file The path of the file to examine.
 
37
@return The modification time, in seconds since January 1st, 1970.
 
38
*/
 
39
 
 
40
time_t timestamp_file( const char *file );
 
41
 
 
42
#endif
 
43