[Positioner] Timestamp: print ns on 9 digits

This commit is contained in:
Matteo Cypriani 2013-07-05 12:43:24 -04:00
parent 10a1cfe1ca
commit b436526d40
1 changed files with 5 additions and 2 deletions

View File

@ -16,6 +16,7 @@
#include "configuration.hh"
#include <iostream>
#include <iomanip>
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 ;
}