Terje Mathisen wrote:

Richard B. Gilbert wrote:

Ulrich Windl wrote:

Talking about 128bit time formats or so: With today's computing power (just
think of MP3 decoders), a switch to BCD coded time in 128 bit should be
sufficient:
Byte#: 1 2  3  4  5  6  7  8  910 111213 141516
Value:2006-07-18 09:26:13.12 1234 567890 123456

So you'd have significant sub-picosecond resolution and peace until year
"9999".

Regards,
Ulrich


Do YOU want to write the code to manipulate that format? It looks like a nightmare to me!


Not at all! It is in effect identical to standard ISO format, plus the fractional part, except for the two-to-one compression achieved by storing in BCD instead of ASCII, but that particular conversion is of course trivial.

BTW, I have written code to convert both ways, between ISO and Unix/NTP seconds, and it is the seconds-to-ISO operations which is the tough one: The naive code takes several hundred clock cycles to do this, while my version did it close to an order of magnitude faster. :-)

For the ascii/bcd fractional part I have also invented a way to convert a 32-bit unsigned number from binary to ascii (the reverse is easy of course) in something like 30-50 clock cycles. AMD stole/borrowed this code (or about 95% of it), without attribution, for their optimization guide.

Terje


I was thinking of the cost of doing all the arithmetic in BCD. The NTP timestamps are exchanged between systems for the purpose of synchronizing to UTC; there is no advantage to exchanging them in BCD. They do not have to be "people readable"!

_______________________________________________
questions mailing list
[email protected]
https://lists.ntp.isc.org/mailman/listinfo/questions

Reply via email to