Skip to content

Commit

Permalink
[PATCH] x86_64: Add useful constants to time.h
Browse files Browse the repository at this point in the history
In timekeeping code, one often does need to use conversion constants. Naming
these leads to code that's easier to understand, showing the reader between
which units the conversion is made.

Signed-off-by: Vojtech Pavlik <vojtech@suse.cz>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Vojtech Pavlik authored and Linus Torvalds committed Jun 26, 2006
1 parent f3fa8eb commit 05ebb76
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions include/linux/time.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@ struct timezone {
#ifdef __KERNEL__

/* Parameters used to convert the timespec values: */
#define MSEC_PER_SEC 1000L
#define USEC_PER_SEC 1000000L
#define NSEC_PER_SEC 1000000000L
#define NSEC_PER_USEC 1000L
#define MSEC_PER_SEC 1000L
#define USEC_PER_MSEC 1000L
#define NSEC_PER_USEC 1000L
#define NSEC_PER_MSEC 1000000L
#define USEC_PER_SEC 1000000L
#define NSEC_PER_SEC 1000000000L
#define FSEC_PER_SEC 1000000000000000L

static inline int timespec_equal(struct timespec *a, struct timespec *b)
{
Expand Down

0 comments on commit 05ebb76

Please sign in to comment.