summaryrefslogtreecommitdiff
path: root/times.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2007-04-27 13:07:01 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 03:38:32 -0400
commit9369beb85b3d65eabfce93b0f0ed59da824b5236 (patch)
treee9323e8ec55ca22ad489435fa9d1630a5a8dad11 /times.cc
parent771f39b69acbc78d5672e7cb95030260866eb33d (diff)
downloadfork-ledger-9369beb85b3d65eabfce93b0f0ed59da824b5236.tar.gz
fork-ledger-9369beb85b3d65eabfce93b0f0ed59da824b5236.tar.bz2
fork-ledger-9369beb85b3d65eabfce93b0f0ed59da824b5236.zip
Everything works with optimization turned on now.
Diffstat (limited to 'times.cc')
-rw-r--r--times.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/times.cc b/times.cc
index 989bf055..8966d598 100644
--- a/times.cc
+++ b/times.cc
@@ -2,13 +2,17 @@
namespace ledger {
-ptime time_now = boost::posix_time::second_clock::universal_time();
-date date_now = boost::gregorian::day_clock::universal_day();
+#ifdef BOOST_DATE_TIME_HAS_HIGH_PRECISION_CLOCK
+const ptime time_now = boost::posix_time::microsec_clock::universal_time();
+#else
+const ptime time_now = boost::posix_time::second_clock::universal_time();
+#endif
+const date date_now = boost::gregorian::day_clock::universal_day();
#ifdef SUPPORT_DATE_AND_TIME
-moment_t& now(time_now);
+const moment_t& now(time_now);
#else
-moment_t& now(date_now);
+const moment_t& now(date_now);
#endif
bool day_before_month = false;