I have device which gives me delay in seconds (
char* to a
std::string. Check that there are exactly 12 digits after the decimal point. Convert those to a
unsigned long long number of picoseconds with
std::strtoull(digits,10); (remember to specify the base explicitly, otherwise the leading zero will make it think it is an octal number).
If you need to handle delays >= 1s, convert the digits before the decimal point to a number of seconds in the same way and add them into the picoseconds with
pico += seconds*(1000ull*1000*1000*1000);
nanoseconds = (picoseconds + 500)/1000;