You might be interested at looking at Daniel J. Bernstein's implementation of TAI (temps atomique international), a 64-bit representation of time values. It can deal with second, nanosecond or attosecond precision, depending on your requirements.
He has a number of essays about time that are worth reading. It should be noted that djb is considered a controversial character in some circles.
Come to YAPC::Europe 2003 in Paris, 23-25 July 2003.