projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Update errors to make sure we return the real error.
[awesomized/libmemcached]
/
libtest
/
timer.cc
diff --git
a/libtest/timer.cc
b/libtest/timer.cc
index 0a8d69b548c71caabb4e52fd6d27d0f77147ebb9..fe164ecfcaa21afef901d7cb52b432160735786e 100644
(file)
--- a/
libtest/timer.cc
+++ b/
libtest/timer.cc
@@
-34,9
+34,12
@@
*
*/
*
*/
-#include <config.h>
+#include "libtest/yatlcon.h"
+
#include <libtest/timer.hpp>
#include <libtest/timer.hpp>
+
#include <ctime>
#include <ctime>
+#include <iomanip>
namespace libtest {
namespace libtest {
@@
-45,9
+48,18
@@
std::ostream& operator<<(std::ostream& output, const libtest::Timer& arg)
struct timespec temp;
arg.difference(temp);
struct timespec temp;
arg.difference(temp);
- output << temp.tv_sec;
+ if (temp.tv_sec > 60)
+ {
+ output << temp.tv_sec / 60;
+ output << "." << temp.tv_sec % 60;
+ }
+ else
+ {
+ output << temp.tv_sec;
+ }
+
output << ":";
output << ":";
- output << temp.tv_nsec;
+ output <<
std::setfill('0') << std::setw(9) <<
temp.tv_nsec;
return output;
}
return output;
}