[Positioner] Timestamp: print ns on 9 digits
This commit is contained in:
parent
10a1cfe1ca
commit
b436526d40
|
@ -16,6 +16,7 @@
|
||||||
#include "configuration.hh"
|
#include "configuration.hh"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <iomanip>
|
||||||
|
|
||||||
using namespace std ;
|
using namespace std ;
|
||||||
|
|
||||||
|
@ -248,9 +249,11 @@ bool Timestamp::operator==(const Timestamp &source) const
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
std::ostream& operator<<(std::ostream &os, const Timestamp &t)
|
ostream& operator<<(ostream &os, const Timestamp &t)
|
||||||
{
|
{
|
||||||
os << t.timestamp.tv_sec << '.' << t.timestamp.tv_nsec ;
|
os << t.timestamp.tv_sec << '.'
|
||||||
|
<< setw(9) << setfill('0') // force nanoseconds on 9 digits
|
||||||
|
<< t.timestamp.tv_nsec ;
|
||||||
return os ;
|
return os ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue