Handling leap seconds on sub second precision UTC time arithmetic

Viewed 195

I'm doing a real time signal processing:

My inputs are samples tagged with timestamps. My outputs are estimations tagged with timestamps in UTC

I need to compensate for processing delay, so at sample N I'll output the estimations of sample N-K, K being my processing delay.

The time compensation must be leap second aware. ie, with a delay of 10ms:

INPUT  TS = 20150701T000000.000000 
OUTPUT TS = 20150630T235960.990000

I thought of struct tm as timestamps, making use of the 61st second.

But I wasn't able to find ( struct tm <-> TAI ) translation functions.

2 Answers
Related