diff options
author | yellow <yellow@10gen.com> | 2008-02-25 22:18:01 +0000 |
---|---|---|
committer | yellow <yellow@10gen.com> | 2008-02-25 22:18:01 +0000 |
commit | dc20e53904feaeccd03c2b864af58e7ef017816e (patch) | |
tree | c0839cdebea7f37bf7dff7879a9711774974054f /util | |
parent | 3be5d865852314623301dd1d7803f42c8a8c3d68 (diff) | |
parent | 3fc3a61fdabc5eb663348b2d1dc5080bbdde6823 (diff) | |
download | mongo-dc20e53904feaeccd03c2b864af58e7ef017816e.tar.gz |
Merge branch 'master' of /data/gitroot/p/
Diffstat (limited to 'util')
-rw-r--r-- | util/goodies.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/util/goodies.h b/util/goodies.h index 98aefd68981..4fa657600bc 100644 --- a/util/goodies.h +++ b/util/goodies.h @@ -63,6 +63,17 @@ struct WrappingInt { bool operator>(WrappingInt r) { return !(r<=*this); }
};
+#include <ctime>
+
+inline void time_t_to_String(time_t t, char *buf) {
+#if defined(_WIN32)
+ ctime_s(buf, 64, &t);
+#else
+ ctime_r(&t, buf);
+#endif
+ buf[24] = 0; // don't want the \n
+}
+
inline void sleepsecs(int s) {
boost::xtime xt;
boost::xtime_get(&xt, boost::TIME_UTC);
|