diff --git a/tests/identity-management-fixture.cpp b/tests/identity-management-fixture.cpp
index ee80dd1..79d5eb2 100644
--- a/tests/identity-management-fixture.cpp
+++ b/tests/identity-management-fixture.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -87,8 +87,8 @@
   request.setName(request.getKeyName().append("parent").appendVersion());
 
   SignatureInfo info;
-  info.setValidityPeriod(security::ValidityPeriod(time::system_clock::now(),
-                                                  time::system_clock::now() + time::days(7300)));
+  auto now = time::system_clock::now();
+  info.setValidityPeriod(security::ValidityPeriod(now, now + 7300_days));
 
   v2::AdditionalDescription description;
   description.set("type", "sub-certificate");
@@ -112,15 +112,15 @@
 
   // set metainfo
   certificate.setContentType(tlv::ContentType_Key);
-  certificate.setFreshnessPeriod(time::hours(1));
+  certificate.setFreshnessPeriod(1_h);
 
   // set content
   certificate.setContent(key.getPublicKey().data(), key.getPublicKey().size());
 
   // set signature-info
   SignatureInfo info;
-  info.setValidityPeriod(security::ValidityPeriod(time::system_clock::now(),
-                                                  time::system_clock::now() + time::days(10)));
+  auto now = time::system_clock::now();
+  info.setValidityPeriod(security::ValidityPeriod(now, now + 10_days));
 
   m_keyChain.sign(certificate, signingByKey(key).setSignatureInfo(info));
   return certificate;
diff --git a/tests/integrated/face.cpp b/tests/integrated/face.cpp
index a8492f1..2884ec6 100644
--- a/tests/integrated/face.cpp
+++ b/tests/integrated/face.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -156,7 +156,7 @@
   std::this_thread::sleep_for(std::chrono::milliseconds(200)); // wait for FIB update to take effect
 
   int nTimeouts = 0;
-  this->face.expressInterest(Interest("/localhost/non-existent-should-timeout", time::seconds(1)),
+  this->face.expressInterest(Interest("/localhost/non-existent-should-timeout", 1_s),
     [] (const Interest&, const Data&) { BOOST_ERROR("unexpected Data"); },
     [] (const Interest&, const lp::Nack&) { BOOST_ERROR("unexpected Nack"); },
     [&] (const Interest&) { ++nTimeouts; });
@@ -179,26 +179,26 @@
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(RegisterUnregisterPrefix, TransportType, Transports, FaceFixture<TransportType>)
 {
-  this->terminateAfter(time::seconds(4));
+  this->terminateAfter(4_s);
 
   int nRegSuccess = 0, nUnregSuccess = 0;
   auto id = this->face.registerPrefix("/Hello/World",
     [&] (const Name&) { ++nRegSuccess; },
     [] (const Name&, const std::string& msg) { BOOST_ERROR("unexpected register prefix failure: " << msg); });
 
-  this->sched.scheduleEvent(time::seconds(1), [&nRegSuccess] {
+  this->sched.scheduleEvent(1_s, [&nRegSuccess] {
     BOOST_CHECK_EQUAL(nRegSuccess, 1);
     std::string output = executeCommand("nfdc route list | grep /Hello/World");
     BOOST_CHECK(!output.empty());
   });
 
-  this->sched.scheduleEvent(time::seconds(2), [this, id, &nUnregSuccess] {
+  this->sched.scheduleEvent(2_s, [this, id, &nUnregSuccess] {
     this->face.unregisterPrefix(id,
       [&] { ++nUnregSuccess; },
       [] (const std::string& msg) { BOOST_ERROR("unexpected unregister prefix failure: " << msg); });
   });
 
-  this->sched.scheduleEvent(time::seconds(3), [&nUnregSuccess] {
+  this->sched.scheduleEvent(3_s, [&nUnregSuccess] {
     BOOST_CHECK_EQUAL(nUnregSuccess, 1);
 
     // Boost.Test would fail if a child process exits with non-zero. http://stackoverflow.com/q/5325202
@@ -211,7 +211,7 @@
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(RegularFilter, TransportType, Transports, FaceFixture<TransportType>)
 {
-  this->terminateAfter(time::seconds(2));
+  this->terminateAfter(2_s);
 
   int nInterests1 = 0, nRegSuccess1 = 0, nRegSuccess2 = 0;
   this->face.setInterestFilter("/Hello/World",
@@ -223,13 +223,13 @@
     [&] (const Name&) { ++nRegSuccess2; },
     [] (const Name&, const std::string& msg) { BOOST_ERROR("unexpected register prefix failure: " << msg); });
 
-  this->sched.scheduleEvent(time::milliseconds(500), [] {
+  this->sched.scheduleEvent(500_ms, [] {
     std::string output = executeCommand("nfdc route list | grep /Hello/World");
     BOOST_CHECK(!output.empty());
   });
 
   char interestOutcome;
-  this->sendInterest(time::seconds(1), Interest("/Hello/World/regular", time::milliseconds(50)), interestOutcome);
+  this->sendInterest(1_s, Interest("/Hello/World/regular", 50_ms), interestOutcome);
 
   this->face.processEvents();
   BOOST_CHECK_EQUAL(interestOutcome, 'T');
@@ -240,7 +240,7 @@
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(RegexFilter, TransportType, Transports, FaceFixture<TransportType>)
 {
-  this->terminateAfter(time::seconds(2));
+  this->terminateAfter(2_s);
 
   int nRegSuccess = 0;
   std::set<Name> receivedInterests;
@@ -249,15 +249,15 @@
     [&] (const Name&) { ++nRegSuccess; },
     [] (const Name&, const std::string& msg) { BOOST_ERROR("unexpected register prefix failure: " << msg); });
 
-  this->sched.scheduleEvent(time::milliseconds(700), [] {
+  this->sched.scheduleEvent(700_ms, [] {
     std::string output = executeCommand("nfdc route list | grep /Hello/World");
     BOOST_CHECK(!output.empty());
   });
 
-  this->sendInterest(time::milliseconds(200), Interest("/Hello/World/a", time::milliseconds(50)));
-  this->sendInterest(time::milliseconds(300), Interest("/Hello/World/a/b", time::milliseconds(50)));
-  this->sendInterest(time::milliseconds(400), Interest("/Hello/World/a/b/c", time::milliseconds(50)));
-  this->sendInterest(time::milliseconds(500), Interest("/Hello/World/a/b/d", time::milliseconds(50)));
+  this->sendInterest(200_ms, Interest("/Hello/World/a", 50_ms));
+  this->sendInterest(300_ms, Interest("/Hello/World/a/b", 50_ms));
+  this->sendInterest(400_ms, Interest("/Hello/World/a/b/c", 50_ms));
+  this->sendInterest(500_ms, Interest("/Hello/World/a/b/d", 50_ms));
 
   this->face.processEvents();
   BOOST_CHECK_EQUAL(nRegSuccess, 1);
@@ -268,29 +268,29 @@
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(RegexFilterNoRegister, TransportType, Transports, FaceFixture<TransportType>)
 {
-  this->terminateAfter(time::seconds(2));
+  this->terminateAfter(2_s);
 
   // no Interest shall arrive because prefix isn't registered in forwarder
   this->face.setInterestFilter(InterestFilter("/Hello/World", "<><b><c>?"),
     [&] (const InterestFilter&, const Interest& interest) { BOOST_ERROR("unexpected Interest"); });
 
-  this->sched.scheduleEvent(time::milliseconds(700), [] {
+  this->sched.scheduleEvent(700_ms, [] {
     // Boost.Test would fail if a child process exits with non-zero. http://stackoverflow.com/q/5325202
     std::string output = executeCommand("nfdc route list | grep /Hello/World || true");
     BOOST_CHECK(output.empty());
   });
 
-  this->sendInterest(time::milliseconds(200), Interest("/Hello/World/a", time::milliseconds(50)));
-  this->sendInterest(time::milliseconds(300), Interest("/Hello/World/a/b", time::milliseconds(50)));
-  this->sendInterest(time::milliseconds(400), Interest("/Hello/World/a/b/c", time::milliseconds(50)));
-  this->sendInterest(time::milliseconds(500), Interest("/Hello/World/a/b/d", time::milliseconds(50)));
+  this->sendInterest(200_ms, Interest("/Hello/World/a", 50_ms));
+  this->sendInterest(300_ms, Interest("/Hello/World/a/b", 50_ms));
+  this->sendInterest(400_ms, Interest("/Hello/World/a/b/c", 50_ms));
+  this->sendInterest(500_ms, Interest("/Hello/World/a/b/d", 50_ms));
 
   this->face.processEvents();
 }
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(PutDataNack, TransportType, Transports, FaceFixture<TransportType>)
 {
-  this->terminateAfter(time::seconds(2));
+  this->terminateAfter(2_s);
 
   this->face.setInterestFilter("/Hello/World",
     [&] (const InterestFilter&, const Interest& interest) {
@@ -305,8 +305,8 @@
     [] (const Name&, const std::string& msg) { BOOST_ERROR("unexpected register prefix failure: " << msg); });
 
   char outcome1, outcome2;
-  this->sendInterest(time::milliseconds(700), Interest("/Hello/World/data", time::milliseconds(50)), outcome1);
-  this->sendInterest(time::milliseconds(800), Interest("/Hello/World/nack", time::milliseconds(50)), outcome2);
+  this->sendInterest(700_ms, Interest("/Hello/World/data", 50_ms), outcome1);
+  this->sendInterest(800_ms, Interest("/Hello/World/nack", 50_ms), outcome2);
 
   this->face.processEvents();
   BOOST_CHECK_EQUAL(outcome1, 'D');
@@ -315,7 +315,7 @@
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(OversizedData, TransportType, Transports, FaceFixture<TransportType>)
 {
-  this->terminateAfter(time::seconds(2));
+  this->terminateAfter(2_s);
 
   this->face.setInterestFilter("/Hello/World",
     [&] (const InterestFilter&, const Interest& interest) {
@@ -324,7 +324,7 @@
     nullptr,
     [] (const Name&, const std::string& msg) { BOOST_ERROR("unexpected register prefix failure: " << msg); });
 
-  this->sendInterest(time::seconds(1), Interest("/Hello/World/oversized", time::milliseconds(50)));
+  this->sendInterest(1_s, Interest("/Hello/World/oversized", 50_ms));
 
   BOOST_CHECK_THROW(this->face.processEvents(), Face::OversizedPacketError);
 }
@@ -336,21 +336,21 @@
 BOOST_AUTO_TEST_CASE(ShutdownWhileSendInProgress) // Bug #3136
 {
   this->face.expressInterest(Interest("/Hello/World"), nullptr, nullptr, nullptr);
-  this->face.processEvents(time::seconds(1));
+  this->face.processEvents(1_s);
 
   this->face.expressInterest(Interest("/Bye/World/1"), nullptr, nullptr, nullptr);
   this->face.expressInterest(Interest("/Bye/World/2"), nullptr, nullptr, nullptr);
   this->face.expressInterest(Interest("/Bye/World/3"), nullptr, nullptr, nullptr);
   this->face.shutdown();
 
-  this->face.processEvents(time::seconds(1)); // should not segfault
+  this->face.processEvents(1_s); // should not segfault
   BOOST_CHECK(true);
 }
 
 BOOST_AUTO_TEST_CASE(LargeDelayBetweenFaceConstructorAndProcessEvents) // Bug #2742
 {
   std::this_thread::sleep_for(std::chrono::seconds(5)); // simulate setup workload
-  this->face.processEvents(time::seconds(1)); // should not throw
+  this->face.processEvents(1_s); // should not throw
   BOOST_CHECK(true);
 }
 
diff --git a/tests/integrated/scheduler-benchmark.cpp b/tests/integrated/scheduler-benchmark.cpp
index 5cc191e..b861f04 100644
--- a/tests/integrated/scheduler-benchmark.cpp
+++ b/tests/integrated/scheduler-benchmark.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -48,7 +48,7 @@
 
   auto d1 = timedExecute([&] {
     for (size_t i = 0; i < nEvents; ++i) {
-      eventIds[i] = sched.scheduleEvent(time::seconds(1), []{});
+      eventIds[i] = sched.scheduleEvent(1_s, []{});
     }
   });
 
@@ -71,11 +71,11 @@
   size_t nExpired = 0;
 
   // Events should expire at t1, but execution finishes at t2. The difference is the overhead.
-  time::steady_clock::TimePoint t1 = time::steady_clock::now() + time::seconds(5);
+  time::steady_clock::TimePoint t1 = time::steady_clock::now() + 5_s;
   time::steady_clock::TimePoint t2;
   // +1ms ensures this extra event is executed last. In case the overhead is less than 1ms,
   // it will be reported as 1ms.
-  sched.scheduleEvent(t1 - time::steady_clock::now() + time::milliseconds(1), [&] {
+  sched.scheduleEvent(t1 - time::steady_clock::now() + 1_ms, [&] {
     t2 = time::steady_clock::now();
     BOOST_REQUIRE_EQUAL(nExpired, nEvents);
   });
diff --git a/tests/unit-tests/data.t.cpp b/tests/unit-tests/data.t.cpp
index 91d46f9..e2054a5 100644
--- a/tests/unit-tests/data.t.cpp
+++ b/tests/unit-tests/data.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -161,7 +161,7 @@
 
   Data d(Name("/local/ndn/prefix"));
   d.setContentType(tlv::ContentType_Blob);
-  d.setFreshnessPeriod(time::seconds(10));
+  d.setFreshnessPeriod(10_s);
   d.setContent(CONTENT1, sizeof(CONTENT1));
 
   Block signatureInfo(tlv::SignatureInfo);
@@ -212,7 +212,7 @@
 
   BOOST_CHECK_EQUAL(d.getName().toUri(), "/local/ndn/prefix");
   BOOST_CHECK_EQUAL(d.getContentType(), static_cast<uint32_t>(tlv::ContentType_Blob));
-  BOOST_CHECK_EQUAL(d.getFreshnessPeriod(), time::seconds(10));
+  BOOST_CHECK_EQUAL(d.getFreshnessPeriod(), 10_s);
   BOOST_CHECK_EQUAL(std::string(reinterpret_cast<const char*>(d.getContent().value()),
                                 d.getContent().value_size()), "SUCCESS!");
   BOOST_CHECK_EQUAL(d.getSignature().getType(), tlv::SignatureSha256WithRsa);
@@ -229,7 +229,7 @@
 {
   Data d(Name("/local/ndn/prefix"));
   d.setContentType(tlv::ContentType_Blob);
-  d.setFreshnessPeriod(time::seconds(10));
+  d.setFreshnessPeriod(10_s);
   d.setContent(CONTENT1, sizeof(CONTENT1));
   BOOST_CHECK_THROW(d.getFullName(), Data::Error); // FullName is unavailable without signing
 
@@ -245,7 +245,7 @@
   // FullName should be cached, so value() pointer points to same memory location
   BOOST_CHECK_EQUAL(fullName.get(-1).value(), d.getFullName().get(-1).value());
 
-  d.setFreshnessPeriod(time::seconds(100)); // invalidates FullName
+  d.setFreshnessPeriod(100_s); // invalidates FullName
   BOOST_CHECK_THROW(d.getFullName(), Data::Error);
 
   Data d1(Block(DATA1, sizeof(DATA1)));
@@ -258,8 +258,6 @@
 
 BOOST_AUTO_TEST_CASE(Equality)
 {
-  using namespace time;
-
   Data a;
   Data b;
   BOOST_CHECK_EQUAL(a == b, true);
@@ -277,11 +275,11 @@
   BOOST_CHECK_EQUAL(a == b, true);
   BOOST_CHECK_EQUAL(a != b, false);
 
-  a.setFreshnessPeriod(seconds(10));
+  a.setFreshnessPeriod(10_s);
   BOOST_CHECK_EQUAL(a == b, false);
   BOOST_CHECK_EQUAL(a != b, true);
 
-  b.setFreshnessPeriod(seconds(10));
+  b.setFreshnessPeriod(10_s);
   BOOST_CHECK_EQUAL(a == b, true);
   BOOST_CHECK_EQUAL(a != b, false);
 
diff --git a/tests/unit-tests/face.t.cpp b/tests/unit-tests/face.t.cpp
index 3c903e9..e731c68 100644
--- a/tests/unit-tests/face.t.cpp
+++ b/tests/unit-tests/face.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -65,7 +65,7 @@
 BOOST_AUTO_TEST_CASE(ExpressInterestData)
 {
   size_t nData = 0;
-  face.expressInterest(Interest("/Hello/World", time::milliseconds(50)),
+  face.expressInterest(Interest("/Hello/World", 50_ms),
                        [&] (const Interest& i, const Data& d) {
                          BOOST_CHECK(i.getName().isPrefixOf(d.getName()));
                          BOOST_CHECK_EQUAL(i.getName(), "/Hello/World");
@@ -74,23 +74,23 @@
                        bind([] { BOOST_FAIL("Unexpected Nack"); }),
                        bind([] { BOOST_FAIL("Unexpected timeout"); }));
 
-  advanceClocks(time::milliseconds(40));
+  advanceClocks(40_ms);
 
   face.receive(*makeData("/Bye/World/a"));
   face.receive(*makeData("/Hello/World/a"));
 
-  advanceClocks(time::milliseconds(50), 2);
+  advanceClocks(50_ms, 2);
 
   BOOST_CHECK_EQUAL(nData, 1);
   BOOST_CHECK_EQUAL(face.sentInterests.size(), 1);
   BOOST_CHECK_EQUAL(face.sentData.size(), 0);
 
   size_t nTimeouts = 0;
-  face.expressInterest(Interest("/Hello/World/a/2", time::milliseconds(50)),
+  face.expressInterest(Interest("/Hello/World/a/2", 50_ms),
                        bind([]{}),
                        bind([]{}),
                        bind([&nTimeouts] { ++nTimeouts; }));
-  advanceClocks(time::milliseconds(200), 5);
+  advanceClocks(200_ms, 5);
   BOOST_CHECK_EQUAL(nTimeouts, 1);
 }
 
@@ -98,25 +98,25 @@
 {
   size_t nData = 0;
 
-  face.expressInterest(Interest("/Hello/World", time::milliseconds(50)),
+  face.expressInterest(Interest("/Hello/World", 50_ms),
                        [&] (const Interest& i, const Data& d) {
                          ++nData;
                        },
                        bind([] { BOOST_FAIL("Unexpected Nack"); }),
                        bind([] { BOOST_FAIL("Unexpected timeout"); }));
 
-  face.expressInterest(Interest("/Hello/World/a", time::milliseconds(50)),
+  face.expressInterest(Interest("/Hello/World/a", 50_ms),
                        [&] (const Interest& i, const Data& d) {
                          ++nData;
                        },
                        bind([] { BOOST_FAIL("Unexpected Nack"); }),
                        bind([] { BOOST_FAIL("Unexpected timeout"); }));
 
-  advanceClocks(time::milliseconds(40));
+  advanceClocks(40_ms);
 
   face.receive(*makeData("/Hello/World/a/b"));
 
-  advanceClocks(time::milliseconds(50), 2);
+  advanceClocks(50_ms, 2);
 
   BOOST_CHECK_EQUAL(nData, 2);
   BOOST_CHECK_EQUAL(face.sentInterests.size(), 2);
@@ -129,18 +129,18 @@
                        nullptr,
                        bind([] { BOOST_FAIL("Unexpected Nack"); }),
                        bind([] { BOOST_FAIL("Unexpected timeout"); }));
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
 
   BOOST_CHECK_NO_THROW(do {
     face.receive(*makeData("/Hello/World/a"));
-    advanceClocks(time::milliseconds(1));
+    advanceClocks(1_ms);
   } while (false));
 }
 
 BOOST_AUTO_TEST_CASE(ExpressInterestTimeout)
 {
   size_t nTimeouts = 0;
-  face.expressInterest(Interest("/Hello/World", time::milliseconds(50)),
+  face.expressInterest(Interest("/Hello/World", 50_ms),
                        bind([] { BOOST_FAIL("Unexpected Data"); }),
                        bind([] { BOOST_FAIL("Unexpected Nack"); }),
                        [&nTimeouts] (const Interest& i) {
@@ -148,7 +148,7 @@
                          ++nTimeouts;
                        });
 
-  advanceClocks(time::milliseconds(200), 5);
+  advanceClocks(200_ms, 5);
 
   BOOST_CHECK_EQUAL(nTimeouts, 1);
   BOOST_CHECK_EQUAL(face.sentInterests.size(), 1);
@@ -158,14 +158,14 @@
 
 BOOST_AUTO_TEST_CASE(ExpressInterestEmptyTimeoutCallback)
 {
-  face.expressInterest(Interest("/Hello/World", time::milliseconds(50)),
+  face.expressInterest(Interest("/Hello/World", 50_ms),
                        bind([] { BOOST_FAIL("Unexpected Data"); }),
                        bind([] { BOOST_FAIL("Unexpected Nack"); }),
                        nullptr);
-  advanceClocks(time::milliseconds(40));
+  advanceClocks(40_ms);
 
   BOOST_CHECK_NO_THROW(do {
-    advanceClocks(time::milliseconds(6), 2);
+    advanceClocks(6_ms, 2);
   } while (false));
 }
 
@@ -173,7 +173,7 @@
 {
   size_t nNacks = 0;
 
-  Interest interest("/Hello/World", time::milliseconds(50));
+  Interest interest("/Hello/World", 50_ms);
 
   face.expressInterest(interest,
                        bind([] { BOOST_FAIL("Unexpected Data"); }),
@@ -185,11 +185,11 @@
                        },
                        bind([] { BOOST_FAIL("Unexpected timeout"); }));
 
-  advanceClocks(time::milliseconds(40));
+  advanceClocks(40_ms);
 
   face.receive(makeNack(face.sentInterests.at(0), lp::NackReason::DUPLICATE));
 
-  advanceClocks(time::milliseconds(50), 2);
+  advanceClocks(50_ms, 2);
 
   BOOST_CHECK_EQUAL(nNacks, 1);
   BOOST_CHECK_EQUAL(face.sentInterests.size(), 1);
@@ -199,7 +199,7 @@
 {
   size_t nNacks = 0;
 
-  Interest interest("/Hello/World", time::milliseconds(50));
+  Interest interest("/Hello/World", 50_ms);
   interest.setNonce(1);
 
   face.expressInterest(interest,
@@ -217,11 +217,11 @@
                        },
                        bind([] { BOOST_FAIL("Unexpected timeout"); }));
 
-  advanceClocks(time::milliseconds(40));
+  advanceClocks(40_ms);
 
   face.receive(makeNack(face.sentInterests.at(1), lp::NackReason::DUPLICATE));
 
-  advanceClocks(time::milliseconds(50), 2);
+  advanceClocks(50_ms, 2);
 
   BOOST_CHECK_EQUAL(nNacks, 2);
   BOOST_CHECK_EQUAL(face.sentInterests.size(), 2);
@@ -233,28 +233,28 @@
                        bind([] { BOOST_FAIL("Unexpected Data"); }),
                        nullptr,
                        bind([] { BOOST_FAIL("Unexpected timeout"); }));
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
 
   BOOST_CHECK_NO_THROW(do {
     face.receive(makeNack(face.sentInterests.at(0), lp::NackReason::DUPLICATE));
-    advanceClocks(time::milliseconds(1));
+    advanceClocks(1_ms);
   } while (false));
 }
 
 BOOST_AUTO_TEST_CASE(RemovePendingInterest)
 {
   const PendingInterestId* interestId =
-    face.expressInterest(Interest("/Hello/World", time::milliseconds(50)),
+    face.expressInterest(Interest("/Hello/World", 50_ms),
                          bind([] { BOOST_FAIL("Unexpected data"); }),
                          bind([] { BOOST_FAIL("Unexpected nack"); }),
                          bind([] { BOOST_FAIL("Unexpected timeout"); }));
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
 
   face.removePendingInterest(interestId);
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
 
   face.receive(*makeData("/Hello/World/%21"));
-  advanceClocks(time::milliseconds(200), 5);
+  advanceClocks(200_ms, 5);
 
   // avoid "test case [...] did not check any assertions" message from Boost.Test
   BOOST_CHECK(true);
@@ -262,38 +262,38 @@
 
 BOOST_AUTO_TEST_CASE(RemoveAllPendingInterests)
 {
-  face.expressInterest(Interest("/Hello/World/0", time::milliseconds(50)),
+  face.expressInterest(Interest("/Hello/World/0", 50_ms),
                        bind([] { BOOST_FAIL("Unexpected data"); }),
                        bind([] { BOOST_FAIL("Unexpected nack"); }),
                        bind([] { BOOST_FAIL("Unexpected timeout"); }));
 
-  face.expressInterest(Interest("/Hello/World/1", time::milliseconds(50)),
+  face.expressInterest(Interest("/Hello/World/1", 50_ms),
                        bind([] { BOOST_FAIL("Unexpected data"); }),
                        bind([] { BOOST_FAIL("Unexpected nack"); }),
                        bind([] { BOOST_FAIL("Unexpected timeout"); }));
 
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
 
   face.removeAllPendingInterests();
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
 
   BOOST_CHECK_EQUAL(face.getNPendingInterests(), 0);
 
   face.receive(*makeData("/Hello/World/0"));
   face.receive(*makeData("/Hello/World/1"));
-  advanceClocks(time::milliseconds(200), 5);
+  advanceClocks(200_ms, 5);
 }
 
 BOOST_AUTO_TEST_CASE(DestructionWithoutCancellingPendingInterests) // Bug #2518
 {
   {
     DummyClientFace face2(io, m_keyChain);
-    face2.expressInterest(Interest("/Hello/World", time::milliseconds(50)),
+    face2.expressInterest(Interest("/Hello/World", 50_ms),
                           nullptr, nullptr, nullptr);
-    advanceClocks(time::milliseconds(50), 2);
+    advanceClocks(50_ms, 2);
   }
 
-  advanceClocks(time::milliseconds(50), 2); // should not crash
+  advanceClocks(50_ms, 2); // should not crash
 
   // avoid "test case [...] did not check any assertions" message from Boost.Test
   BOOST_CHECK(true);
@@ -317,7 +317,7 @@
   data.setTag(make_shared<lp::CongestionMarkTag>(1));
   face.put(data);
 
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
   BOOST_REQUIRE_EQUAL(face.sentData.size(), 2);
   BOOST_CHECK(face.sentData[0].getTag<lp::CachePolicyTag>() == nullptr);
   BOOST_CHECK(face.sentData[0].getTag<lp::CongestionMarkTag>() == nullptr);
@@ -342,13 +342,13 @@
                        bind([&] { hasData = true; }),
                        bind([] { BOOST_FAIL("Unexpected nack"); }),
                        bind([] { BOOST_FAIL("Unexpected timeout"); }));
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(hasInterest1, true); // Interest looped back
   BOOST_CHECK_EQUAL(face.sentInterests.size(), 1); // Interest sent to forwarder
   BOOST_CHECK_EQUAL(hasData, false); // waiting for Data
 
   face.put(*makeData("/A/B")); // first InterestFilter responds with Data
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(hasData, true);
   BOOST_CHECK_EQUAL(face.sentData.size(), 0); // do not spill Data to forwarder
 }
@@ -363,10 +363,10 @@
     face.put(*makeData("/A/B"));
   }));
   face.setInterestFilter("/", bind([]{}));
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
 
   face.receive(*makeInterest("/A"));
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
   BOOST_CHECK(hasInterest1);
   BOOST_CHECK_EQUAL(face.sentData.size(), 1);
   BOOST_CHECK_EQUAL(face.sentData.at(0).getName(), "/A/B");
@@ -378,20 +378,20 @@
 BOOST_AUTO_TEST_CASE(PutNack)
 {
   face.setInterestFilter("/", bind([]{})); // register one Interest destination so that face can accept Nacks
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
 
   BOOST_CHECK_EQUAL(face.sentNacks.size(), 0);
 
   face.put(makeNack("/unsolicited", 18645250, lp::NackReason::NO_ROUTE));
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
   BOOST_CHECK_EQUAL(face.sentNacks.size(), 0); // unsolicited Nack would not be sent
 
   face.receive(*makeInterest("/Hello/World", 14247162));
   face.receive(*makeInterest("/another/prefix", 92203002));
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
 
   face.put(makeNack("/Hello/World", 14247162, lp::NackReason::DUPLICATE));
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
   BOOST_REQUIRE_EQUAL(face.sentNacks.size(), 1);
   BOOST_CHECK_EQUAL(face.sentNacks[0].getReason(), lp::NackReason::DUPLICATE);
   BOOST_CHECK(face.sentNacks[0].getTag<lp::CongestionMarkTag>() == nullptr);
@@ -399,7 +399,7 @@
   auto nack = makeNack("/another/prefix", 92203002, lp::NackReason::NO_ROUTE);
   nack.setTag(make_shared<lp::CongestionMarkTag>(1));
   face.put(nack);
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
   BOOST_REQUIRE_EQUAL(face.sentNacks.size(), 2);
   BOOST_CHECK_EQUAL(face.sentNacks[1].getReason(), lp::NackReason::NO_ROUTE);
   BOOST_CHECK(face.sentNacks[1].getTag<lp::CongestionMarkTag>() != nullptr);
@@ -415,10 +415,10 @@
     face.put(makeNack(interest, lp::NackReason::CONGESTION));
   });
   face.setInterestFilter("/", bind([&] { hasInterest2 = true; }));
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
 
   face.receive(*makeInterest("/A", 14333271));
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
   BOOST_CHECK(hasInterest1);
   BOOST_CHECK(hasInterest2);
 
@@ -426,7 +426,7 @@
   BOOST_CHECK_EQUAL(face.sentNacks.size(), 0);
 
   face.put(makeNack("/A", 14333271, lp::NackReason::NO_ROUTE)); // Nack from second destination
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
   BOOST_CHECK_EQUAL(face.sentNacks.size(), 1); // sending Nack after both destinations Nacked
   BOOST_CHECK_EQUAL(face.sentNacks.at(0).getReason(), lp::NackReason::CONGESTION); // least severe reason
 
@@ -454,13 +454,13 @@
                          BOOST_CHECK_EQUAL(nack.getReason(), lp::NackReason::CONGESTION);
                        },
                        bind([] { BOOST_FAIL("Unexpected timeout"); }));
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(hasInterest1, true); // Interest looped back
   BOOST_CHECK_EQUAL(face.sentInterests.size(), 1); // Interest sent to forwarder
   BOOST_CHECK_EQUAL(hasNack, false); // waiting for Nack from forwarder
 
   face.receive(makeNack("/A", 28395852, lp::NackReason::NO_ROUTE));
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(hasNack, true);
 }
 
@@ -473,46 +473,46 @@
                            bind([&nInterests] { ++nInterests; }),
                            bind([&nRegs] { ++nRegs; }),
                            bind([] {  BOOST_FAIL("Unexpected setInterestFilter failure"); }));
-  advanceClocks(time::milliseconds(25), 4);
+  advanceClocks(25_ms, 4);
   BOOST_CHECK_EQUAL(nRegs, 1);
   BOOST_CHECK_EQUAL(nInterests, 0);
 
   face.receive(Interest("/Hello/World/%21"));
-  advanceClocks(time::milliseconds(25), 4);
+  advanceClocks(25_ms, 4);
 
   BOOST_CHECK_EQUAL(nRegs, 1);
   BOOST_CHECK_EQUAL(nInterests, 1);
 
   face.receive(Interest("/Bye/World/%21"));
-  advanceClocks(time::milliseconds(10000), 10);
+  advanceClocks(10000_ms, 10);
   BOOST_CHECK_EQUAL(nInterests, 1);
 
   face.receive(Interest("/Hello/World/%21/2"));
-  advanceClocks(time::milliseconds(25), 4);
+  advanceClocks(25_ms, 4);
   BOOST_CHECK_EQUAL(nInterests, 2);
 
   // removing filter
   face.unsetInterestFilter(regPrefixId);
-  advanceClocks(time::milliseconds(25), 4);
+  advanceClocks(25_ms, 4);
 
   face.receive(Interest("/Hello/World/%21/3"));
   BOOST_CHECK_EQUAL(nInterests, 2);
 
   face.unsetInterestFilter(static_cast<const RegisteredPrefixId*>(nullptr));
-  advanceClocks(time::milliseconds(25), 4);
+  advanceClocks(25_ms, 4);
 
   face.unsetInterestFilter(static_cast<const InterestFilterId*>(nullptr));
-  advanceClocks(time::milliseconds(25), 4);
+  advanceClocks(25_ms, 4);
 }
 
 BOOST_AUTO_TEST_CASE(SetInterestFilterEmptyInterestCallback)
 {
   face.setInterestFilter("/A", nullptr);
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
 
   BOOST_CHECK_NO_THROW(do {
     face.receive(*makeInterest("/A/1"));
-    advanceClocks(time::milliseconds(1));
+    advanceClocks(1_ms);
   } while (false));
 }
 
@@ -523,34 +523,34 @@
     face.setInterestFilter("/Hello/World",
                            bind([&nInterests] { ++nInterests; }),
                            bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
-  advanceClocks(time::milliseconds(25), 4);
+  advanceClocks(25_ms, 4);
   BOOST_CHECK_EQUAL(nInterests, 0);
 
   face.receive(Interest("/Hello/World/%21"));
-  advanceClocks(time::milliseconds(25), 4);
+  advanceClocks(25_ms, 4);
 
   BOOST_CHECK_EQUAL(nInterests, 1);
 
   face.receive(Interest("/Bye/World/%21"));
-  advanceClocks(time::milliseconds(10000), 10);
+  advanceClocks(10000_ms, 10);
   BOOST_CHECK_EQUAL(nInterests, 1);
 
   face.receive(Interest("/Hello/World/%21/2"));
-  advanceClocks(time::milliseconds(25), 4);
+  advanceClocks(25_ms, 4);
   BOOST_CHECK_EQUAL(nInterests, 2);
 
   // removing filter
   face.unsetInterestFilter(regPrefixId);
-  advanceClocks(time::milliseconds(25), 4);
+  advanceClocks(25_ms, 4);
 
   face.receive(Interest("/Hello/World/%21/3"));
   BOOST_CHECK_EQUAL(nInterests, 2);
 
   face.unsetInterestFilter(static_cast<const RegisteredPrefixId*>(nullptr));
-  advanceClocks(time::milliseconds(25), 4);
+  advanceClocks(25_ms, 4);
 
   face.unsetInterestFilter(static_cast<const InterestFilterId*>(nullptr));
-  advanceClocks(time::milliseconds(25), 4);
+  advanceClocks(25_ms, 4);
 }
 
 BOOST_FIXTURE_TEST_CASE(SetInterestFilterFail, FacesNoRegistrationReplyFixture)
@@ -562,10 +562,10 @@
                          bind([] { BOOST_FAIL("Unexpected success of setInterestFilter"); }),
                          bind([&nRegFailed] { ++nRegFailed; }));
 
-  advanceClocks(time::milliseconds(25), 4);
+  advanceClocks(25_ms, 4);
   BOOST_CHECK_EQUAL(nRegFailed, 0);
 
-  advanceClocks(time::milliseconds(2000), 5);
+  advanceClocks(2000_ms, 5);
   BOOST_CHECK_EQUAL(nRegFailed, 1);
 }
 
@@ -577,10 +577,10 @@
                          bind([] { BOOST_FAIL("Unexpected Interest"); }),
                          bind([&nRegFailed] { ++nRegFailed; }));
 
-  advanceClocks(time::milliseconds(25), 4);
+  advanceClocks(25_ms, 4);
   BOOST_CHECK_EQUAL(nRegFailed, 0);
 
-  advanceClocks(time::milliseconds(2000), 5);
+  advanceClocks(2000_ms, 5);
   BOOST_CHECK_EQUAL(nRegFailed, 1);
 }
 
@@ -592,7 +592,7 @@
                         bind([&nRegSuccesses] { ++nRegSuccesses; }),
                         bind([] { BOOST_FAIL("Unexpected registerPrefix failure"); }));
 
-  advanceClocks(time::milliseconds(25), 4);
+  advanceClocks(25_ms, 4);
   BOOST_CHECK_EQUAL(nRegSuccesses, 1);
 
   size_t nUnregSuccesses = 0;
@@ -600,7 +600,7 @@
                         bind([&nUnregSuccesses] { ++nUnregSuccesses; }),
                         bind([] { BOOST_FAIL("Unexpected unregisterPrefix failure"); }));
 
-  advanceClocks(time::milliseconds(25), 4);
+  advanceClocks(25_ms, 4);
   BOOST_CHECK_EQUAL(nUnregSuccesses, 1);
 }
 
@@ -612,7 +612,7 @@
                       bind([] { BOOST_FAIL("Unexpected registerPrefix success"); }),
                       bind([&nRegFailures] { ++nRegFailures; }));
 
-  advanceClocks(time::milliseconds(5000), 20);
+  advanceClocks(5000_ms, 20);
   BOOST_CHECK_EQUAL(nRegFailures, 1);
 }
 
@@ -636,10 +636,10 @@
                          nullptr,
                          bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
 
-  advanceClocks(time::milliseconds(25), 4);
+  advanceClocks(25_ms, 4);
 
   face.receive(Interest("/Hello/World/%21"));
-  advanceClocks(time::milliseconds(25), 4);
+  advanceClocks(25_ms, 4);
 
   BOOST_CHECK_EQUAL(nInInterests1, 1);
   BOOST_CHECK_EQUAL(nInInterests2, 1);
@@ -655,7 +655,7 @@
                          nullptr,
                          bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
 
-  advanceClocks(time::milliseconds(25), 4);
+  advanceClocks(25_ms, 4);
 
   BOOST_REQUIRE_THROW(face.receive(Interest("/Hello/World/XXX/b/c")), InterestFilter::Error);
 }
@@ -668,7 +668,7 @@
                          nullptr,
                          bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
 
-  advanceClocks(time::milliseconds(25), 4);
+  advanceClocks(25_ms, 4);
 
   face.receive(Interest("/Hello/World/a"));     // shouldn't match
   BOOST_CHECK_EQUAL(nInInterests, 0);
@@ -694,7 +694,7 @@
                       bind([&nRegSuccesses] { ++nRegSuccesses; }),
                       bind([] { BOOST_FAIL("Unexpected setInterestFilter failure"); }));
 
-  advanceClocks(time::milliseconds(25), 4);
+  advanceClocks(25_ms, 4);
   BOOST_CHECK_EQUAL(nRegSuccesses, 1);
 
   face.receive(Interest("/Hello/World/a")); // shouldn't match
diff --git a/tests/unit-tests/ims/in-memory-storage-persistent.t.cpp b/tests/unit-tests/ims/in-memory-storage-persistent.t.cpp
index 9be6430..1ae637d 100644
--- a/tests/unit-tests/ims/in-memory-storage-persistent.t.cpp
+++ b/tests/unit-tests/ims/in-memory-storage-persistent.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -48,7 +48,7 @@
     convert << i;
     Name name("/" + convert.str());
     shared_ptr<Data> data = makeData(name);
-    data->setFreshnessPeriod(time::milliseconds(5000));
+    data->setFreshnessPeriod(5000_ms);
     signData(data);
     ims.insert(*data);
   }
diff --git a/tests/unit-tests/ims/in-memory-storage.t.cpp b/tests/unit-tests/ims/in-memory-storage.t.cpp
index b493001..5a731b1 100644
--- a/tests/unit-tests/ims/in-memory-storage.t.cpp
+++ b/tests/unit-tests/ims/in-memory-storage.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -66,14 +66,14 @@
 
   uint32_t content1 = 1;
   shared_ptr<Data> data1 = makeData(name);
-  data1->setFreshnessPeriod(time::milliseconds(99999));
+  data1->setFreshnessPeriod(99999_ms);
   data1->setContent(reinterpret_cast<const uint8_t*>(&content1), sizeof(content1));
   signData(data1);
   ims.insert(*data1);
 
   uint32_t content2 = 2;
   shared_ptr<Data> data2 = makeData(name);
-  data2->setFreshnessPeriod(time::milliseconds(99999));
+  data2->setFreshnessPeriod(99999_ms);
   data2->setContent(reinterpret_cast<const uint8_t*>(&content2), sizeof(content2));
   signData(data2);
   ims.insert(*data2);
@@ -212,14 +212,14 @@
 
   uint32_t content1 = 1;
   shared_ptr<Data> data1 = makeData(name);
-  data1->setFreshnessPeriod(time::milliseconds(99999));
+  data1->setFreshnessPeriod(99999_ms);
   data1->setContent(reinterpret_cast<const uint8_t*>(&content1), sizeof(content1));
   signData(data1);
   ims.insert(*data1);
 
   uint32_t content2 = 2;
   shared_ptr<Data> data2 = makeData(name);
-  data2->setFreshnessPeriod(time::milliseconds(99999));
+  data2->setFreshnessPeriod(99999_ms);
   data2->setContent(reinterpret_cast<const uint8_t*>(&content2), sizeof(content2));
   signData(data2);
   ims.insert(*data2);
@@ -659,7 +659,7 @@
     convert << i;
     Name name("/" + convert.str());
     shared_ptr<Data> data = makeData(name);
-    data->setFreshnessPeriod(time::milliseconds(5000));
+    data->setFreshnessPeriod(5000_ms);
     signData(data);
     ims.insert(*data);
   }
@@ -706,7 +706,7 @@
          const time::milliseconds& freshWindow = InMemoryStorage::INFINITE_WINDOW)
   {
     shared_ptr<Data> data = makeData(name);
-    data->setFreshnessPeriod(time::milliseconds(99999));
+    data->setFreshnessPeriod(99999_ms);
     data->setContent(reinterpret_cast<const uint8_t*>(&id), sizeof(id));
     signData(data);
 
@@ -978,10 +978,10 @@
 
 BOOST_AUTO_TEST_CASE(MustBeFresh)
 {
-  Name data1Name = insert(1, "ndn:/A/1", time::milliseconds(500));
-  insert(2, "ndn:/A/2", time::milliseconds(2500));
-  insert(3, "ndn:/A/3", time::milliseconds(3500));
-  insert(4, "ndn:/A/4", time::milliseconds(1500));
+  Name data1Name = insert(1, "ndn:/A/1", 500_ms);
+  insert(2, "ndn:/A/2", 2500_ms);
+  insert(3, "ndn:/A/3", 3500_ms);
+  insert(4, "ndn:/A/4", 1500_ms);
 
   // @0s, all Data are fresh
   startInterest("ndn:/A/1")
@@ -1002,7 +1002,7 @@
     .setChildSelector(1);
   BOOST_CHECK_EQUAL(find(), 4);
 
-  advanceClocks(time::milliseconds(1000));
+  advanceClocks(1000_ms);
   // @1s, /A/1 is stale
   startInterest("ndn:/A/1")
     .setMustBeFresh(true);
@@ -1025,7 +1025,7 @@
     .setChildSelector(0);
   BOOST_CHECK_EQUAL(find(), 1);
 
-  advanceClocks(time::milliseconds(1000));
+  advanceClocks(1000_ms);
   // @2s, /A/1 and /A/4 are stale
   startInterest("ndn:/A")
     .setMustBeFresh(true)
@@ -1036,7 +1036,7 @@
     .setChildSelector(1);
   BOOST_CHECK_EQUAL(find(), 4);
 
-  advanceClocks(time::milliseconds(2000));
+  advanceClocks(2000_ms);
   // @4s, all Data are stale
   startInterest("ndn:/A")
     .setMustBeFresh(true)
diff --git a/tests/unit-tests/interest-filter.t.cpp b/tests/unit-tests/interest-filter.t.cpp
index 8277c23..157fa05 100644
--- a/tests/unit-tests/interest-filter.t.cpp
+++ b/tests/unit-tests/interest-filter.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -57,7 +57,7 @@
   util::DummyClientFace face;
   face.setInterestFilter(InterestFilter("/Hello/World", "<><b><c>?"),
     [] (const Name&, const Interest&) { BOOST_ERROR("unexpected Interest"); });
-  face.processEvents(time::milliseconds(1));
+  face.processEvents(1_ms);
   BOOST_CHECK_THROW(face.receive(Interest("/Hello/World/a/b/c")), InterestFilter::Error);
 }
 
diff --git a/tests/unit-tests/interest.t.cpp b/tests/unit-tests/interest.t.cpp
index 7c5d0f0..c1dc23d 100644
--- a/tests/unit-tests/interest.t.cpp
+++ b/tests/unit-tests/interest.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -93,7 +93,7 @@
   i1.setName("/local/ndn/prefix");
   i1.setMinSuffixComponents(1);
   i1.setNonce(1);
-  i1.setInterestLifetime(time::milliseconds(1000));
+  i1.setInterestLifetime(1000_ms);
   i1.setForwardingHint({{1, "/A"}});
   Block wire1 = i1.wireEncode();
   BOOST_CHECK_EQUAL_COLLECTIONS(wire1.begin(), wire1.end(), WIRE, WIRE + sizeof(WIRE));
@@ -102,7 +102,7 @@
   BOOST_CHECK_EQUAL(i2.getName(), "/local/ndn/prefix");
   BOOST_CHECK_EQUAL(i2.getMinSuffixComponents(), 1);
   BOOST_CHECK_EQUAL(i2.getNonce(), 1);
-  BOOST_CHECK_EQUAL(i2.getInterestLifetime(), time::milliseconds(1000));
+  BOOST_CHECK_EQUAL(i2.getInterestLifetime(), 1000_ms);
   BOOST_CHECK_EQUAL(i2.getForwardingHint(), DelegationList({{1, "/A"}}));
 
   BOOST_CHECK_EQUAL(i1, i2);
@@ -114,11 +114,11 @@
   i1.setName("/test");
   i1.setMinSuffixComponents(100);
   i1.setNonce(10);
-  i1.setInterestLifetime(time::seconds(10));
+  i1.setInterestLifetime(10_s);
 
   Interest i2(i1.wireEncode());
   BOOST_CHECK_EQUAL(i2.getName().toUri(), "/test");
-  BOOST_CHECK_EQUAL(i2.getInterestLifetime(), time::seconds(10));
+  BOOST_CHECK_EQUAL(i2.getInterestLifetime(), 10_s);
   BOOST_CHECK_EQUAL(i2.getMinSuffixComponents(), 100);
   BOOST_CHECK_EQUAL(i2.getNonce(), 10);
 
@@ -254,7 +254,7 @@
     .setPublisherPublicKeyLocator(KeyLocator("/B"))
     .setExclude(Exclude().excludeAfter(name::Component("J")))
     .setNonce(10)
-    .setInterestLifetime(time::seconds(5))
+    .setInterestLifetime(5_s)
     .setForwardingHint({{1, "/H"}});
 
   Interest other;
@@ -272,7 +272,7 @@
   other.setNonce(200);
   BOOST_CHECK_EQUAL(interest.matchesInterest(other), true);
 
-  other.setInterestLifetime(time::hours(5));
+  other.setInterestLifetime(5_h);
   BOOST_CHECK_EQUAL(interest.matchesInterest(other), true);
 }
 
@@ -334,17 +334,17 @@
 BOOST_AUTO_TEST_CASE(SetInterestLifetime)
 {
   BOOST_CHECK_THROW(Interest("/A", time::milliseconds(-1)), std::invalid_argument);
-  BOOST_CHECK_NO_THROW(Interest("/A", time::milliseconds(0)));
+  BOOST_CHECK_NO_THROW(Interest("/A", 0_ms));
 
   Interest i("/local/ndn/prefix");
   i.setNonce(1);
   BOOST_CHECK_EQUAL(i.getInterestLifetime(), DEFAULT_INTEREST_LIFETIME);
   BOOST_CHECK_THROW(i.setInterestLifetime(time::milliseconds(-1)), std::invalid_argument);
   BOOST_CHECK_EQUAL(i.getInterestLifetime(), DEFAULT_INTEREST_LIFETIME);
-  i.setInterestLifetime(time::milliseconds(0));
-  BOOST_CHECK_EQUAL(i.getInterestLifetime(), time::milliseconds(0));
-  i.setInterestLifetime(time::milliseconds(1));
-  BOOST_CHECK_EQUAL(i.getInterestLifetime(), time::milliseconds(1));
+  i.setInterestLifetime(0_ms);
+  BOOST_CHECK_EQUAL(i.getInterestLifetime(), 0_ms);
+  i.setInterestLifetime(1_ms);
+  BOOST_CHECK_EQUAL(i.getInterestLifetime(), 1_ms);
 }
 
 BOOST_AUTO_TEST_CASE(ModifyForwardingHint)
@@ -405,11 +405,11 @@
   BOOST_CHECK_EQUAL(a != b, false);
 
   // compare InterestLifetime
-  a.setInterestLifetime(time::seconds(10));
+  a.setInterestLifetime(10_s);
   BOOST_CHECK_EQUAL(a == b, false);
   BOOST_CHECK_EQUAL(a != b, true);
 
-  b.setInterestLifetime(time::seconds(10));
+  b.setInterestLifetime(10_s);
   BOOST_CHECK_EQUAL(a == b, true);
   BOOST_CHECK_EQUAL(a != b, false);
 
diff --git a/tests/unit-tests/meta-info.t.cpp b/tests/unit-tests/meta-info.t.cpp
index bbd3fef..43935e3 100644
--- a/tests/unit-tests/meta-info.t.cpp
+++ b/tests/unit-tests/meta-info.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -41,7 +41,7 @@
 {
   MetaInfo meta;
   meta.setType(tlv::ContentType_Blob);
-  meta.setFreshnessPeriod(time::seconds(10));
+  meta.setFreshnessPeriod(10_s);
 
   BOOST_REQUIRE_NO_THROW(meta.wireEncode());
   BOOST_REQUIRE_EQUAL_COLLECTIONS(MetaInfo1, MetaInfo1+sizeof(MetaInfo1),
@@ -62,38 +62,36 @@
 {
   MetaInfo meta(Block(MetaInfo1, sizeof(MetaInfo1)));
   BOOST_CHECK_EQUAL(meta.getType(), static_cast<uint32_t>(tlv::ContentType_Blob));
-  BOOST_CHECK_EQUAL(meta.getFreshnessPeriod(), time::seconds(10));
+  BOOST_CHECK_EQUAL(meta.getFreshnessPeriod(), 10_s);
   BOOST_CHECK_EQUAL(meta.getFinalBlockId(), name::Component());
 
   meta.wireDecode(Block(MetaInfo2, sizeof(MetaInfo2)));
   BOOST_CHECK_EQUAL(meta.getType(), static_cast<uint32_t>(tlv::ContentType_Blob));
-  BOOST_CHECK_EQUAL(meta.getFreshnessPeriod(), time::seconds(10));
+  BOOST_CHECK_EQUAL(meta.getFreshnessPeriod(), 10_s);
   BOOST_CHECK_EQUAL(meta.getFinalBlockId(), name::Component("hello,world!"));
 
   meta.wireDecode(Block(MetaInfo3, sizeof(MetaInfo3)));
   BOOST_CHECK_EQUAL(meta.getType(), static_cast<uint32_t>(tlv::ContentType_Link));
-  BOOST_CHECK_EQUAL(meta.getFreshnessPeriod(), time::seconds(10));
+  BOOST_CHECK_EQUAL(meta.getFreshnessPeriod(), 10_s);
   BOOST_CHECK_EQUAL(meta.getFinalBlockId(), name::Component("hello,world!"));
 }
 
 BOOST_AUTO_TEST_CASE(EqualityChecks)
 {
-  using namespace time;
-
   MetaInfo a;
   MetaInfo b;
   BOOST_CHECK_EQUAL(a == b, true);
   BOOST_CHECK_EQUAL(a != b, false);
 
-  a.setFreshnessPeriod(seconds(10));
+  a.setFreshnessPeriod(10_s);
   BOOST_CHECK_EQUAL(a == b, false);
   BOOST_CHECK_EQUAL(a != b, true);
 
-  b.setFreshnessPeriod(milliseconds(90000));
+  b.setFreshnessPeriod(90_s);
   BOOST_CHECK_EQUAL(a == b, false);
   BOOST_CHECK_EQUAL(a != b, true);
 
-  b.setFreshnessPeriod(milliseconds(10000));
+  b.setFreshnessPeriod(10_s);
   BOOST_CHECK_EQUAL(a == b, true);
   BOOST_CHECK_EQUAL(a != b, false);
 
@@ -110,7 +108,7 @@
 {
   MetaInfo info1;
   info1.setType(196);
-  info1.setFreshnessPeriod(time::milliseconds(3600));
+  info1.setFreshnessPeriod(3600_ms);
   info1.setFinalBlockId(name::Component("/att/final"));
 
   uint32_t ints[5] = {128, 129, 130, 131, 132};
@@ -210,7 +208,7 @@
   BOOST_CHECK_EQUAL_COLLECTIONS(info.wireEncode().begin(), info.wireEncode().end(),
                                 expectedDefault, expectedDefault + sizeof(expectedDefault));
 
-  info.setFreshnessPeriod(time::milliseconds(1000));
+  info.setFreshnessPeriod(1000_ms);
   BOOST_CHECK_EQUAL_COLLECTIONS(info.wireEncode().begin(), info.wireEncode().end(),
                                 expected1000ms, expected1000ms + sizeof(expected1000ms));
 
@@ -232,12 +230,12 @@
 
   Block input2000msBlock(input2000ms, sizeof(input2000ms));
   BOOST_CHECK_NO_THROW(info.wireDecode(input2000msBlock));
-  BOOST_CHECK_EQUAL(info.getFreshnessPeriod(), time::milliseconds(2000));
+  BOOST_CHECK_EQUAL(info.getFreshnessPeriod(), 2000_ms);
 
-  BOOST_CHECK_NO_THROW(info.setFreshnessPeriod(time::milliseconds(10000)));
-  BOOST_CHECK_EQUAL(info.getFreshnessPeriod(), time::milliseconds(10000));
+  BOOST_CHECK_NO_THROW(info.setFreshnessPeriod(10000_ms));
+  BOOST_CHECK_EQUAL(info.getFreshnessPeriod(), 10000_ms);
   BOOST_CHECK_THROW(info.setFreshnessPeriod(time::milliseconds(-1)), std::invalid_argument);
-  BOOST_CHECK_EQUAL(info.getFreshnessPeriod(), time::milliseconds(10000));
+  BOOST_CHECK_EQUAL(info.getFreshnessPeriod(), 10000_ms);
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestMetaInfo
diff --git a/tests/unit-tests/mgmt/dispatcher.t.cpp b/tests/unit-tests/mgmt/dispatcher.t.cpp
index 535e8bd..9f8d34d 100644
--- a/tests/unit-tests/mgmt/dispatcher.t.cpp
+++ b/tests/unit-tests/mgmt/dispatcher.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -158,49 +158,49 @@
                                        bind([&nCallbackCalled] { ++nCallbackCalled["test/2"]; }));
 
   face.receive(*makeInterest("/root/1/test/1/%80%00"));
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(nCallbackCalled["test/1"], 0);
   BOOST_CHECK_EQUAL(nCallbackCalled["test/2"], 0);
 
   dispatcher.addTopPrefix("/root/1");
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
 
   face.receive(*makeInterest("/root/1/test/1/%80%00"));
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(nCallbackCalled["test/1"], 1);
   BOOST_CHECK_EQUAL(nCallbackCalled["test/2"], 0);
 
   face.receive(*makeInterest("/root/1/test/2/%80%00"));
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(nCallbackCalled["test/1"], 1);
   BOOST_CHECK_EQUAL(nCallbackCalled["test/2"], 1);
 
   face.receive(*makeInterest("/root/2/test/1/%80%00"));
   face.receive(*makeInterest("/root/2/test/2/%80%00"));
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(nCallbackCalled["test/1"], 1);
   BOOST_CHECK_EQUAL(nCallbackCalled["test/2"], 1);
 
   dispatcher.addTopPrefix("/root/2");
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
 
   face.receive(*makeInterest("/root/1/test/1/%80%00"));
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(nCallbackCalled["test/1"], 2);
 
   face.receive(*makeInterest("/root/2/test/1/%80%00"));
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(nCallbackCalled["test/1"], 3);
 
   dispatcher.removeTopPrefix("/root/1");
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
 
   face.receive(*makeInterest("/root/1/test/1/%80%00"));
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(nCallbackCalled["test/1"], 3);
 
   face.receive(*makeInterest("/root/2/test/1/%80%00"));
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(nCallbackCalled["test/1"], 4);
 }
 
@@ -214,7 +214,7 @@
                                        bind([&nCallbackCalled] { ++nCallbackCalled; }));
 
   dispatcher.addTopPrefix("/root");
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   face.sentData.clear();
 
   face.receive(*makeInterest("/root/test/%80%00")); // returns 403
@@ -222,7 +222,7 @@
   face.receive(*makeInterest("/root/test/%80%00/silent")); // silently ignored
   face.receive(*makeInterest("/root/test/.../invalid")); // silently ignored (wrong format)
   face.receive(*makeInterest("/root/test/.../valid"));  // silently ignored (wrong format)
-  advanceClocks(time::milliseconds(1), 20);
+  advanceClocks(1_ms, 20);
   BOOST_CHECK_EQUAL(nCallbackCalled, 0);
   BOOST_CHECK_EQUAL(face.sentData.size(), 2);
 
@@ -232,7 +232,7 @@
   BOOST_CHECK_EQUAL(ControlResponse(face.sentData[1].getContent().blockFromValue()).getCode(), 403);
 
   face.receive(*makeInterest("/root/test/%80%00/valid"));
-  advanceClocks(time::milliseconds(1), 10);
+  advanceClocks(1_ms, 10);
   BOOST_CHECK_EQUAL(nCallbackCalled, 1);
 }
 
@@ -290,15 +290,15 @@
                                            bind([&nCallbackCalled] { ++nCallbackCalled; }));
 
   dispatcher.addTopPrefix("/root");
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
 
   face.receive(*makeInterest("/root/test/%80%00"));
   BOOST_CHECK_EQUAL(nCallbackCalled, 0);
   BOOST_REQUIRE(authorizationAccept != nullptr);
 
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   authorizationAccept("");
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(nCallbackCalled, 1);
 }
 
@@ -345,13 +345,13 @@
                               });
 
   dispatcher.addTopPrefix("/root");
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   face.sentData.clear();
 
   face.receive(*makeInterest("/root/test/small/%80%00")); // returns 403
   face.receive(*makeInterest("/root/test/small/%80%00/invalid")); // returns 403
   face.receive(*makeInterest("/root/test/small/%80%00/silent")); // silently ignored
-  advanceClocks(time::milliseconds(1), 20);
+  advanceClocks(1_ms, 20);
   BOOST_CHECK_EQUAL(face.sentData.size(), 2);
 
   BOOST_CHECK(face.sentData[0].getContentType() == tlv::ContentType_Blob);
@@ -363,7 +363,7 @@
 
   auto interestSmall = *makeInterest("/root/test/small/valid");
   face.receive(interestSmall);
-  advanceClocks(time::milliseconds(1), 10);
+  advanceClocks(1_ms, 10);
 
   // one data packet is generated and sent to both places
   BOOST_CHECK_EQUAL(face.sentData.size(), 1);
@@ -375,7 +375,7 @@
 
   face.receive(*makeInterest(Name("/root/test/small/valid").appendVersion(10))); // should be ignored
   face.receive(*makeInterest(Name("/root/test/small/valid").appendSegment(20))); // should be ignored
-  advanceClocks(time::milliseconds(1), 10);
+  advanceClocks(1_ms, 10);
   BOOST_CHECK_EQUAL(face.sentData.size(), 1);
   BOOST_CHECK_EQUAL(storage.size(), 1);
 
@@ -390,7 +390,7 @@
   storage.erase("/", true); // clear the storage
   face.sentData.clear();
   face.receive(*makeInterest("/root/test/large/valid"));
-  advanceClocks(time::milliseconds(1), 10);
+  advanceClocks(1_ms, 10);
 
   // two data packets are generated, the first one will be sent to both places
   // while the second one will only be inserted into the in-memory storage
@@ -429,7 +429,7 @@
   storage.erase("/", true);// clear the storage
   face.sentData.clear();
   face.receive(*makeInterest("/root/test/reject/%80%00/valid")); // returns nack
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(face.sentData.size(), 1);
   BOOST_CHECK(face.sentData[0].getContentType() == tlv::ContentType_Nack);
   BOOST_CHECK_EQUAL(ControlResponse(face.sentData[0].getContent().blockFromValue()).getCode(), 400);
@@ -443,22 +443,22 @@
   auto post = dispatcher.addNotificationStream("test");
 
   post(block);
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(face.sentData.size(), 0);
 
   dispatcher.addTopPrefix("/root");
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   face.sentData.clear();
 
   post(block);
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(face.sentData.size(), 1);
   BOOST_CHECK_EQUAL(storage.size(), 1);
 
   post(block);
   post(block);
   post(block);
-  advanceClocks(time::milliseconds(1), 10);
+  advanceClocks(1_ms, 10);
 
   BOOST_CHECK_EQUAL(face.sentData.size(), 4);
   BOOST_CHECK_EQUAL(face.sentData[0].getName(), "/root/test/%FE%00");
diff --git a/tests/unit-tests/mgmt/nfd/command-options.t.cpp b/tests/unit-tests/mgmt/nfd/command-options.t.cpp
index 470cac9..e8fe76e 100644
--- a/tests/unit-tests/mgmt/nfd/command-options.t.cpp
+++ b/tests/unit-tests/mgmt/nfd/command-options.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2016 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -37,15 +37,15 @@
   CommandOptions co;
   BOOST_CHECK_EQUAL(co.getTimeout(), CommandOptions::DEFAULT_TIMEOUT);
 
-  co.setTimeout(time::milliseconds(7414));
-  BOOST_CHECK_EQUAL(co.getTimeout(), time::milliseconds(7414));
+  co.setTimeout(7414_ms);
+  BOOST_CHECK_EQUAL(co.getTimeout(), 7414_ms);
 
   BOOST_CHECK_THROW(co.setTimeout(time::milliseconds::zero()), std::out_of_range);
   BOOST_CHECK_THROW(co.setTimeout(time::milliseconds(-1)), std::out_of_range);
-  BOOST_CHECK_EQUAL(co.getTimeout(), time::milliseconds(7414)); // unchanged after throw
+  BOOST_CHECK_EQUAL(co.getTimeout(), 7414_ms); // unchanged after throw
 
-  co.setTimeout(time::milliseconds(1));
-  BOOST_CHECK_EQUAL(co.getTimeout(), time::milliseconds(1));
+  co.setTimeout(1_ms);
+  BOOST_CHECK_EQUAL(co.getTimeout(), 1_ms);
 }
 
 BOOST_AUTO_TEST_CASE(Prefix)
diff --git a/tests/unit-tests/mgmt/nfd/control-parameters.t.cpp b/tests/unit-tests/mgmt/nfd/control-parameters.t.cpp
index 8f8f98a..199ba3b 100644
--- a/tests/unit-tests/mgmt/nfd/control-parameters.t.cpp
+++ b/tests/unit-tests/mgmt/nfd/control-parameters.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -111,7 +111,7 @@
             .setOrigin(ROUTE_ORIGIN_NLSR)
             .setCost(6)
             .setFlags(0x01)
-            .setExpirationPeriod(time::minutes(30));
+            .setExpirationPeriod(30_min);
 
   Block wire = parameters.wireEncode();
 
@@ -121,7 +121,7 @@
   BOOST_CHECK_EQUAL(decoded.getOrigin(), ROUTE_ORIGIN_NLSR);
   BOOST_CHECK_EQUAL(decoded.getCost(), 6);
   BOOST_CHECK_EQUAL(decoded.getFlags(), 0x01);
-  BOOST_CHECK_EQUAL(decoded.getExpirationPeriod(), time::milliseconds(1800000));
+  BOOST_CHECK_EQUAL(decoded.getExpirationPeriod(), 1800000_ms);
 
   BOOST_CHECK_EQUAL(decoded.hasUri(), false);
   BOOST_CHECK_EQUAL(decoded.hasLocalUri(), false);
diff --git a/tests/unit-tests/mgmt/nfd/controller.t.cpp b/tests/unit-tests/mgmt/nfd/controller.t.cpp
index 92fcedd..e9a3c4f 100644
--- a/tests/unit-tests/mgmt/nfd/controller.t.cpp
+++ b/tests/unit-tests/mgmt/nfd/controller.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -48,7 +48,7 @@
     auto responseData = makeData(face.sentInterests.at(0).getName());
     responseData->setContent(responsePayload.wireEncode());
     face.receive(*responseData);
-    this->advanceClocks(time::milliseconds(1));
+    this->advanceClocks(1_ms);
   }
 
 private:
@@ -86,7 +86,7 @@
   parameters.setUri("tcp4://192.0.2.1:6363");
 
   controller.start<FaceCreateCommand>(parameters, succeedCallback, commandFailCallback);
-  this->advanceClocks(time::milliseconds(1));
+  this->advanceClocks(1_ms);
 
   BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
   const Interest& requestInterest = face.sentInterests[0];
@@ -119,7 +119,7 @@
   parameters.setUri("tcp4://192.0.2.1:6363");
 
   controller.start<FaceCreateCommand>(parameters, nullptr, commandFailCallback);
-  this->advanceClocks(time::milliseconds(1));
+  this->advanceClocks(1_ms);
 
   ControlParameters responseBody = makeFaceCreateResponse();
   ControlResponse responsePayload(201, "created");
@@ -139,7 +139,7 @@
   options.setPrefix("/localhop/net/example/router1/nfd");
 
   controller.start<RibRegisterCommand>(parameters, succeedCallback, commandFailCallback, options);
-  this->advanceClocks(time::milliseconds(1));
+  this->advanceClocks(1_ms);
 
   BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
   const Interest& requestInterest = face.sentInterests[0];
@@ -167,7 +167,7 @@
   parameters.setUri("tcp4://192.0.2.1:6363");
 
   controller.start<FaceCreateCommand>(parameters, succeedCallback, commandFailCallback);
-  this->advanceClocks(time::milliseconds(1));
+  this->advanceClocks(1_ms);
 
   ControlParameters responseBody = makeFaceCreateResponse();
   ControlResponse responsePayload(201, "created");
@@ -185,7 +185,7 @@
   parameters.setUri("tcp4://192.0.2.1:6363");
 
   controller.start<FaceCreateCommand>(parameters, succeedCallback, commandFailCallback);
-  this->advanceClocks(time::milliseconds(1));
+  this->advanceClocks(1_ms);
 
   ControlResponse responsePayload(401, "Not Authenticated");
   this->respond(responsePayload);
@@ -201,7 +201,7 @@
   parameters.setUri("tcp4://192.0.2.1:6363");
 
   controller.start<FaceCreateCommand>(parameters, succeedCallback, commandFailCallback);
-  this->advanceClocks(time::milliseconds(1));
+  this->advanceClocks(1_ms);
 
   ControlParameters responseBody = makeFaceCreateResponse();
   responseBody.unsetFaceId() // FaceId is missing
@@ -220,14 +220,14 @@
   parameters.setUri("tcp4://192.0.2.1:6363");
 
   controller.start<FaceCreateCommand>(parameters, succeedCallback, commandFailCallback);
-  this->advanceClocks(time::milliseconds(1));
+  this->advanceClocks(1_ms);
 
   BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
   const Interest& requestInterest = face.sentInterests[0];
 
   auto responseNack = makeNack(requestInterest, lp::NackReason::NO_ROUTE);
   face.receive(responseNack);
-  this->advanceClocks(time::milliseconds(1));
+  this->advanceClocks(1_ms);
 
   BOOST_REQUIRE_EQUAL(failCodes.size(), 1);
   BOOST_CHECK_EQUAL(failCodes.back(), Controller::ERROR_NACK);
@@ -239,11 +239,11 @@
   parameters.setUri("tcp4://192.0.2.1:6363");
 
   CommandOptions options;
-  options.setTimeout(time::milliseconds(50));
+  options.setTimeout(50_ms);
 
   controller.start<FaceCreateCommand>(parameters, succeedCallback, commandFailCallback, options);
-  this->advanceClocks(time::milliseconds(1)); // express Interest
-  this->advanceClocks(time::milliseconds(51)); // timeout
+  this->advanceClocks(1_ms); // express Interest
+  this->advanceClocks(51_ms); // timeout
 
   BOOST_REQUIRE_EQUAL(failCodes.size(), 1);
   BOOST_CHECK_EQUAL(failCodes.back(), Controller::ERROR_TIMEOUT);
@@ -255,11 +255,11 @@
   parameters.setUri("tcp4://192.0.2.1:6363");
 
   CommandOptions options;
-  options.setTimeout(time::milliseconds(50));
+  options.setTimeout(50_ms);
 
   controller.start<FaceCreateCommand>(parameters, succeedCallback, nullptr, options);
-  this->advanceClocks(time::milliseconds(1)); // express Interest
-  this->advanceClocks(time::milliseconds(51)); // timeout
+  this->advanceClocks(1_ms); // express Interest
+  this->advanceClocks(51_ms); // timeout
 
   BOOST_CHECK_EQUAL(succeeds.size(), 0);
 }
diff --git a/tests/unit-tests/mgmt/nfd/face-status.t.cpp b/tests/unit-tests/mgmt/nfd/face-status.t.cpp
index 16fe108..dee1de2 100644
--- a/tests/unit-tests/mgmt/nfd/face-status.t.cpp
+++ b/tests/unit-tests/mgmt/nfd/face-status.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -42,7 +42,7 @@
       .setFaceScope(FACE_SCOPE_LOCAL)
       .setFacePersistency(FACE_PERSISTENCY_ON_DEMAND)
       .setLinkType(LINK_TYPE_MULTI_ACCESS)
-      .setExpirationPeriod(time::seconds(10))
+      .setExpirationPeriod(10_s)
       .setNInInterests(10)
       .setNInData(200)
       .setNInNacks(1)
@@ -135,9 +135,9 @@
   FaceStatus status;
   BOOST_CHECK_EQUAL(status.hasExpirationPeriod(), false);
 
-  status.setExpirationPeriod(time::minutes(1));
+  status.setExpirationPeriod(1_min);
   BOOST_REQUIRE_EQUAL(status.hasExpirationPeriod(), true);
-  BOOST_CHECK_EQUAL(status.getExpirationPeriod(), time::minutes(1));
+  BOOST_CHECK_EQUAL(status.getExpirationPeriod(), 1_min);
 
   status.unsetExpirationPeriod();
   BOOST_CHECK_EQUAL(status.hasExpirationPeriod(), false);
diff --git a/tests/unit-tests/mgmt/nfd/rib-entry.t.cpp b/tests/unit-tests/mgmt/nfd/rib-entry.t.cpp
index 15c14d1..f2ab51a 100644
--- a/tests/unit-tests/mgmt/nfd/rib-entry.t.cpp
+++ b/tests/unit-tests/mgmt/nfd/rib-entry.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -48,13 +48,13 @@
   return RibEntry()
       .setName("/hello/world")
       .addRoute(makeRoute()
-                .setExpirationPeriod(time::seconds(10)));
+                .setExpirationPeriod(10_s));
 }
 
 BOOST_AUTO_TEST_CASE(RouteEncode)
 {
   Route route1 = makeRoute();
-  route1.setExpirationPeriod(time::seconds(10));
+  route1.setExpirationPeriod(10_s);
   const Block& wire = route1.wireEncode();
 
   static const uint8_t expected[] = {
@@ -89,15 +89,15 @@
   BOOST_CHECK_EQUAL(route.hasExpirationPeriod(), false);
   BOOST_CHECK_EQUAL(route.getExpirationPeriod(), time::milliseconds::max());
 
-  route.setExpirationPeriod(time::minutes(1));
+  route.setExpirationPeriod(1_min);
   BOOST_CHECK_EQUAL(route.hasExpirationPeriod(), true);
-  BOOST_CHECK_EQUAL(route.getExpirationPeriod(), time::minutes(1));
+  BOOST_CHECK_EQUAL(route.getExpirationPeriod(), 1_min);
 
   route.setExpirationPeriod(time::milliseconds::max());
   BOOST_CHECK_EQUAL(route.hasExpirationPeriod(), false);
   BOOST_CHECK_EQUAL(route.getExpirationPeriod(), time::milliseconds::max());
 
-  route.setExpirationPeriod(time::minutes(1));
+  route.setExpirationPeriod(1_min);
   BOOST_CHECK_EQUAL(route.hasExpirationPeriod(), true);
 
   route.unsetExpirationPeriod();
@@ -116,7 +116,7 @@
   BOOST_CHECK_NE(route1, route2);
 
   route2 = route1;
-  route2.setExpirationPeriod(time::minutes(1));
+  route2.setExpirationPeriod(1_min);
   BOOST_CHECK_NE(route1, route2);
 }
 
@@ -128,7 +128,7 @@
                   .setOrigin(ROUTE_ORIGIN_APP)
                   .setCost(32)
                   .setFlags(ROUTE_FLAG_CHILD_INHERIT)
-                  .setExpirationPeriod(time::seconds(5)));
+                  .setExpirationPeriod(5_s));
   const Block& wire = entry1.wireEncode();
 
   static const uint8_t expected[] = {
diff --git a/tests/unit-tests/mgmt/nfd/status-dataset.t.cpp b/tests/unit-tests/mgmt/nfd/status-dataset.t.cpp
index 990f7f1..2abbdaa 100644
--- a/tests/unit-tests/mgmt/nfd/status-dataset.t.cpp
+++ b/tests/unit-tests/mgmt/nfd/status-dataset.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -110,12 +110,12 @@
 BOOST_AUTO_TEST_CASE(Timeout)
 {
   CommandOptions options;
-  options.setTimeout(time::milliseconds(3000));
+  options.setTimeout(3000_ms);
   controller.fetch<FaceDataset>(
     [] (const std::vector<FaceStatus>& result) { BOOST_FAIL("fetchDataset should not succeed"); },
     datasetFailCallback,
     options);
-  this->advanceClocks(time::milliseconds(500), 7);
+  this->advanceClocks(500_ms, 7);
 
   BOOST_REQUIRE_EQUAL(failCodes.size(), 1);
   BOOST_CHECK_EQUAL(failCodes.back(), Controller::ERROR_TIMEOUT);
@@ -126,10 +126,10 @@
   controller.fetch<FaceDataset>(
     [] (const std::vector<FaceStatus>& result) { BOOST_FAIL("fetchDataset should not succeed"); },
     datasetFailCallback);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   face.receive(*makeData("/localhost/nfd/faces/list/%FD%00"));
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   BOOST_REQUIRE_EQUAL(failCodes.size(), 1);
   BOOST_CHECK_EQUAL(failCodes.back(), Controller::ERROR_SERVER);
@@ -142,12 +142,12 @@
   controller.fetch<FaceDataset>(
     [] (const std::vector<FaceStatus>& result) { BOOST_FAIL("fetchDataset should not succeed"); },
     datasetFailCallback);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   FaceStatus payload;
   payload.setFaceId(5744);
   this->sendDataset("/localhost/nfd/faces/list", payload);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   BOOST_REQUIRE_EQUAL(failCodes.size(), 1);
   BOOST_CHECK_EQUAL(failCodes.back(), Controller::ERROR_VALIDATION);
@@ -158,11 +158,11 @@
   controller.fetch<FaceDataset>(
     [] (const std::vector<FaceStatus>& result) { BOOST_FAIL("fetchDataset should not succeed"); },
     datasetFailCallback);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
   face.receive(lp::Nack(face.sentInterests.back()));
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   BOOST_REQUIRE_EQUAL(failCodes.size(), 1);
   BOOST_CHECK_EQUAL(failCodes.back(), Controller::ERROR_NACK);
@@ -173,11 +173,11 @@
   controller.fetch<FaceDataset>(
     [] (const std::vector<FaceStatus>& result) { BOOST_FAIL("fetchDataset should not succeed"); },
     datasetFailCallback);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   Name payload; // Name is not valid FaceStatus
   this->sendDataset("/localhost/nfd/faces/list", payload);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   BOOST_REQUIRE_EQUAL(failCodes.size(), 1);
   BOOST_CHECK_EQUAL(failCodes.back(), Controller::ERROR_SERVER);
@@ -188,13 +188,13 @@
   controller.fetch<FaceDataset>(
     [] (const std::vector<FaceStatus>& result) { BOOST_FAIL("fetchDataset should not succeed"); },
     datasetFailCallback);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   FaceStatus payload1;
   payload1.setFaceId(10930);
   Name payload2; // Name is not valid FaceStatus
   this->sendDataset("/localhost/nfd/faces/list", payload1, payload2);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   BOOST_REQUIRE_EQUAL(failCodes.size(), 1);
   BOOST_CHECK_EQUAL(failCodes.back(), Controller::ERROR_SERVER);
@@ -209,12 +209,12 @@
   controller.fetch<FaceDataset>(
     nullptr,
     datasetFailCallback);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   FaceStatus payload;
   payload.setFaceId(2577);
   this->sendDataset("/localhost/nfd/faces/list", payload);
-  BOOST_CHECK_NO_THROW(this->advanceClocks(time::milliseconds(500)));
+  BOOST_CHECK_NO_THROW(this->advanceClocks(500_ms));
 
   BOOST_CHECK_EQUAL(failCodes.size(), 0);
 }
@@ -222,12 +222,12 @@
 BOOST_AUTO_TEST_CASE(Failure)
 {
   CommandOptions options;
-  options.setTimeout(time::milliseconds(3000));
+  options.setTimeout(3000_ms);
   controller.fetch<FaceDataset>(
     [] (const std::vector<FaceStatus>& result) { BOOST_FAIL("fetchDataset should not succeed"); },
     nullptr,
     options);
-  BOOST_CHECK_NO_THROW(this->advanceClocks(time::milliseconds(500), 7));
+  BOOST_CHECK_NO_THROW(this->advanceClocks(500_ms, 7));
 }
 
 BOOST_AUTO_TEST_SUITE_END() // NoCallback
@@ -243,12 +243,12 @@
       BOOST_CHECK_EQUAL(result.getNfdVersion(), "0.4.2");
     },
     datasetFailCallback);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   ForwarderStatus payload;
   payload.setNfdVersion("0.4.2");
   this->sendDataset("/localhost/nfd/status/general", payload);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   BOOST_CHECK(hasResult);
   BOOST_CHECK_EQUAL(failCodes.size(), 0);
@@ -264,14 +264,14 @@
       BOOST_CHECK_EQUAL(result.front().getFaceId(), 24485);
     },
     datasetFailCallback);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   FaceStatus payload1;
   payload1.setFaceId(24485);
   FaceStatus payload2;
   payload2.setFaceId(12987);
   this->sendDataset("/localhost/nfd/faces/list", payload1, payload2);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   BOOST_CHECK(hasResult);
   BOOST_CHECK_EQUAL(failCodes.size(), 0);
@@ -290,14 +290,14 @@
       BOOST_CHECK_EQUAL(result.front().getFaceId(), 8795);
     },
     datasetFailCallback);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   Name prefix("/localhost/nfd/faces/query");
   prefix.append(filter.wireEncode());
   FaceStatus payload;
   payload.setFaceId(8795);
   this->sendDataset(prefix, payload);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   BOOST_CHECK(hasResult);
   BOOST_CHECK_EQUAL(failCodes.size(), 0);
@@ -308,7 +308,7 @@
   FaceQueryFilter filter;
   filter.setUriScheme("udp4");
   CommandOptions options;
-  options.setTimeout(time::milliseconds(3000));
+  options.setTimeout(3000_ms);
   bool hasResult = false;
   controller.fetch<FaceQueryDataset>(
     filter,
@@ -319,14 +319,14 @@
     },
     datasetFailCallback,
     options);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   Name prefix("/localhost/nfd/faces/query");
   prefix.append(filter.wireEncode());
   FaceStatus payload;
   payload.setFaceId(14022);
   this->sendDataset(prefix, payload);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   BOOST_CHECK(hasResult);
   BOOST_CHECK_EQUAL(failCodes.size(), 0);
@@ -342,14 +342,14 @@
       BOOST_CHECK_EQUAL(result.front().getLocalUri(), "tcp4://192.0.2.1:6363");
     },
     datasetFailCallback);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   ChannelStatus payload1;
   payload1.setLocalUri("tcp4://192.0.2.1:6363");
   ChannelStatus payload2;
   payload2.setLocalUri("udp4://192.0.2.1:6363");
   this->sendDataset("/localhost/nfd/faces/channels", payload1, payload2);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   BOOST_CHECK(hasResult);
   BOOST_CHECK_EQUAL(failCodes.size(), 0);
@@ -365,14 +365,14 @@
       BOOST_CHECK_EQUAL(result.front().getPrefix(), "/wYs7fzYcfG");
     },
     datasetFailCallback);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   FibEntry payload1;
   payload1.setPrefix("/wYs7fzYcfG");
   FibEntry payload2;
   payload2.setPrefix("/LKvmnzY5S");
   this->sendDataset("/localhost/nfd/fib/list", payload1, payload2);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   BOOST_CHECK(hasResult);
   BOOST_CHECK_EQUAL(failCodes.size(), 0);
@@ -389,12 +389,12 @@
       BOOST_CHECK_EQUAL(result.getNHits(), 4539);
     },
     datasetFailCallback);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   CsInfo payload;
   payload.setNHits(4539);
   this->sendDataset("/localhost/nfd/cs/info", payload);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   BOOST_CHECK(hasResult);
   BOOST_CHECK_EQUAL(failCodes.size(), 0);
@@ -410,14 +410,14 @@
       BOOST_CHECK_EQUAL(result.front().getName(), "/8MLz6N3B");
     },
     datasetFailCallback);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   StrategyChoice payload1;
   payload1.setName("/8MLz6N3B");
   StrategyChoice payload2;
   payload2.setName("/svqcBu0YwU");
   this->sendDataset("/localhost/nfd/strategy-choice/list", payload1, payload2);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   BOOST_CHECK(hasResult);
   BOOST_CHECK_EQUAL(failCodes.size(), 0);
@@ -433,14 +433,14 @@
       BOOST_CHECK_EQUAL(result.front().getName(), "/zXxBth97ee");
     },
     datasetFailCallback);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   RibEntry payload1;
   payload1.setName("/zXxBth97ee");
   RibEntry payload2;
   payload2.setName("/rJ8CvUpr4G");
   this->sendDataset("/localhost/nfd/rib/list", payload1, payload2);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   BOOST_CHECK(hasResult);
   BOOST_CHECK_EQUAL(failCodes.size(), 0);
@@ -459,12 +459,12 @@
     },
     datasetFailCallback,
     options);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   RibEntry payload;
   payload.setName("/e6L5K4ascd");
   this->sendDataset("/localhop/nfd/rib/list", payload);
-  this->advanceClocks(time::milliseconds(500));
+  this->advanceClocks(500_ms);
 
   BOOST_CHECK(hasResult);
   BOOST_CHECK_EQUAL(failCodes.size(), 0);
diff --git a/tests/unit-tests/mgmt/status-dataset-context.t.cpp b/tests/unit-tests/mgmt/status-dataset-context.t.cpp
index 5c432a7..c5af199 100644
--- a/tests/unit-tests/mgmt/status-dataset-context.t.cpp
+++ b/tests/unit-tests/mgmt/status-dataset-context.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -54,7 +54,7 @@
               [this] (const ControlResponse& resp) {
                 sendNackHistory.push_back(resp);
               })
-    , defaultImsFresh(time::milliseconds(1000))
+    , defaultImsFresh(1000_ms)
   {
   }
 
@@ -141,8 +141,8 @@
 
 BOOST_AUTO_TEST_CASE(GetAndSet)
 {
-  auto period = time::milliseconds(9527);
-  BOOST_CHECK_EQUAL(context.getExpiry(), time::milliseconds(1000));
+  auto period = 9527_ms;
+  BOOST_CHECK_EQUAL(context.getExpiry(), 1000_ms);
   BOOST_CHECK_EQUAL(context.setExpiry(period).getExpiry(), period);
 }
 
diff --git a/tests/unit-tests/name-component.t.cpp b/tests/unit-tests/name-component.t.cpp
index d91ce24..9463144 100644
--- a/tests/unit-tests/name-component.t.cpp
+++ b/tests/unit-tests/name-component.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -297,7 +297,7 @@
             bind(&name::Component::toTimestamp, _1),
             [] (Name& name, time::system_clock::TimePoint t) -> Name& { return name.appendTimestamp(t); },
             Name("/%FC%00%04%7BE%E3%1B%00%00"),
-            time::getUnixEpoch() + time::days(14600), // 40 years
+            time::getUnixEpoch() + 14600_days, // 40 years
             bind(&name::Component::isTimestamp, _1)};
   }
 };
diff --git a/tests/unit-tests/net/face-uri.t.cpp b/tests/unit-tests/net/face-uri.t.cpp
index 1dd40c8..1f90f67 100644
--- a/tests/unit-tests/net/face-uri.t.cpp
+++ b/tests/unit-tests/net/face-uri.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California,
+ * Copyright (c) 2013-2018 Regents of the University of California,
  *                         Arizona Board of Regents,
  *                         Colorado State University,
  *                         University Pierre & Marie Curie, Sorbonne University,
@@ -49,7 +49,7 @@
     FaceUri uri(request);
     uri.canonize(bind(&CanonizeFixture::onCanonizeSuccess, this, tc, _1),
                  bind(&CanonizeFixture::onCanonizeFailure, this, tc, _1),
-                 m_io, time::seconds(10));
+                 m_io, 10_s);
   }
 
   void
@@ -575,22 +575,22 @@
   // unsupported scheme
   FaceUri("null://").canonize(FaceUri::CanonizeSuccessCallback(),
                               FaceUri::CanonizeFailureCallback(),
-                              io, time::milliseconds(1));
+                              io, 1_ms);
 
   // cannot resolve
   FaceUri("udp://192.0.2.333").canonize(FaceUri::CanonizeSuccessCallback(),
                                         FaceUri::CanonizeFailureCallback(),
-                                        io, time::milliseconds(1));
+                                        io, 1_ms);
 
   // already canonical
   FaceUri("udp4://192.0.2.1:6363").canonize(FaceUri::CanonizeSuccessCallback(),
                                             FaceUri::CanonizeFailureCallback(),
-                                            io, time::milliseconds(1));
+                                            io, 1_ms);
 
   // need DNS resolution
   FaceUri("udp://192.0.2.1:6363").canonize(FaceUri::CanonizeSuccessCallback(),
                                            FaceUri::CanonizeFailureCallback(),
-                                           io, time::milliseconds(1));
+                                           io, 1_ms);
 
   io.run(); // should not crash
 
diff --git a/tests/unit-tests/security/command-interest-signer.t.cpp b/tests/unit-tests/security/command-interest-signer.t.cpp
index 4c95293..784a209 100644
--- a/tests/unit-tests/security/command-interest-signer.t.cpp
+++ b/tests/unit-tests/security/command-interest-signer.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -55,7 +55,7 @@
   BOOST_CHECK_NE(i2.getName().at(command_interest::POS_RANDOM_VAL),
                  i1.getName().at(command_interest::POS_RANDOM_VAL)); // this sometimes can fail
 
-  advanceClocks(time::seconds(100));
+  advanceClocks(100_s);
 
   i2 = signer.makeCommandInterest("/hello/world/!");
   BOOST_CHECK_GT(i2.getName().at(command_interest::POS_TIMESTAMP), i1.getName().at(command_interest::POS_TIMESTAMP));
diff --git a/tests/unit-tests/security/pib/detail/key-impl.t.cpp b/tests/unit-tests/security/pib/detail/key-impl.t.cpp
index ec51751..517ea60 100644
--- a/tests/unit-tests/security/pib/detail/key-impl.t.cpp
+++ b/tests/unit-tests/security/pib/detail/key-impl.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -156,7 +156,7 @@
   auto otherCert = id1Key1Cert1;
   SignatureInfo info;
   info.setValidityPeriod(ValidityPeriod(time::system_clock::now(),
-                                        time::system_clock::now() + time::seconds(1)));
+                                        time::system_clock::now() + 1_s));
   m_keyChain.sign(otherCert, SigningInfo().setSignatureInfo(info));
 
   BOOST_CHECK_EQUAL(otherCert.getName(), id1Key1Cert1.getName());
diff --git a/tests/unit-tests/security/pib/pib-data-fixture.cpp b/tests/unit-tests/security/pib/pib-data-fixture.cpp
index 0856b85..91e5b34 100644
--- a/tests/unit-tests/security/pib/pib-data-fixture.cpp
+++ b/tests/unit-tests/security/pib/pib-data-fixture.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -52,7 +52,7 @@
 //           .appendVersion(certVersion);
 //         v2::Certificate cert;
 //         cert.setName(certName);
-//         cert.setFreshnessPeriod(time::hours(1));
+//         cert.setFreshnessPeriod(1_h);
 //         cert.setContent(tpm.getPublicKey(keyName));
 
 //         // @TODO sign using the new KeyChain
diff --git a/tests/unit-tests/security/signature-sha256-with-ecdsa.t.cpp b/tests/unit-tests/security/signature-sha256-with-ecdsa.t.cpp
index cb2cf00..edc15d7 100644
--- a/tests/unit-tests/security/signature-sha256-with-ecdsa.t.cpp
+++ b/tests/unit-tests/security/signature-sha256-with-ecdsa.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -127,16 +127,16 @@
   Interest interest("/SecurityTestSignatureSha256WithEcdsa/InterestSignature/Interest1");
   Interest interest11("/SecurityTestSignatureSha256WithEcdsa/InterestSignature/Interest1");
 
-  scheduler.scheduleEvent(time::milliseconds(100), [&] {
+  scheduler.scheduleEvent(100_ms, [&] {
       BOOST_CHECK_NO_THROW(m_keyChain.sign(interest, security::SigningInfo(identity)));
     });
 
-  advanceClocks(time::milliseconds(100));
-  scheduler.scheduleEvent(time::milliseconds(100), [&] {
+  advanceClocks(100_ms);
+  scheduler.scheduleEvent(100_ms, [&] {
       BOOST_CHECK_NO_THROW(m_keyChain.sign(interest11, security::SigningInfo(identity)));
     });
 
-  advanceClocks(time::milliseconds(100));
+  advanceClocks(100_ms);
 
   Block interestBlock(interest.wireEncode().wire(), interest.wireEncode().size());
 
diff --git a/tests/unit-tests/security/signature-sha256-with-rsa.t.cpp b/tests/unit-tests/security/signature-sha256-with-rsa.t.cpp
index 510bb1f..4348ade 100644
--- a/tests/unit-tests/security/signature-sha256-with-rsa.t.cpp
+++ b/tests/unit-tests/security/signature-sha256-with-rsa.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -132,16 +132,16 @@
   Interest interest("/SecurityTestSignatureSha256WithRsa/InterestSignature/Interest1");
   Interest interest11("/SecurityTestSignatureSha256WithRsa/InterestSignature/Interest1");
 
-  scheduler.scheduleEvent(time::milliseconds(100), [&] {
+  scheduler.scheduleEvent(100_ms, [&] {
       BOOST_CHECK_NO_THROW(m_keyChain.sign(interest, security::SigningInfo(identity)));
     });
 
-  advanceClocks(time::milliseconds(100));
-  scheduler.scheduleEvent(time::milliseconds(100), [&] {
+  advanceClocks(100_ms);
+  scheduler.scheduleEvent(100_ms, [&] {
       BOOST_CHECK_NO_THROW(m_keyChain.sign(interest11, security::SigningInfo(identity)));
     });
 
-  advanceClocks(time::milliseconds(100));
+  advanceClocks(100_ms);
 
   Block interestBlock(interest.wireEncode().wire(), interest.wireEncode().size());
 
diff --git a/tests/unit-tests/security/v2/certificate-bundle-fetcher.t.cpp b/tests/unit-tests/security/v2/certificate-bundle-fetcher.t.cpp
index b837339..f9bc22c 100644
--- a/tests/unit-tests/security/v2/certificate-bundle-fetcher.t.cpp
+++ b/tests/unit-tests/security/v2/certificate-bundle-fetcher.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -126,7 +126,7 @@
 
   shared_ptr<Data> certBundle = make_shared<Data>();
   certBundle->setName(bundleName);
-  certBundle->setFreshnessPeriod(time::seconds(100));
+  certBundle->setFreshnessPeriod(100_s);
   certBundle->setContent(certList);
   certBundle->setFinalBlockId(name::Component::fromSegment(1));
 
@@ -139,7 +139,7 @@
 void
 CertificateBundleFetcherFixture<Timeout>::makeResponse(const Interest& interest)
 {
-  this->advanceClocks(time::seconds(200));
+  this->advanceClocks(200_s);
 }
 
 template<>
diff --git a/tests/unit-tests/security/v2/certificate-cache.t.cpp b/tests/unit-tests/security/v2/certificate-cache.t.cpp
index 56c7dd0..4ae3505 100644
--- a/tests/unit-tests/security/v2/certificate-cache.t.cpp
+++ b/tests/unit-tests/security/v2/certificate-cache.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -36,7 +36,7 @@
 {
 public:
   CertificateCacheFixture()
-    : certCache(time::seconds(10))
+    : certCache(10_s)
   {
     identity = addIdentity("/TestCertificateCache/");
     cert = identity.getDefaultKey().getDefaultCertificate();
@@ -57,16 +57,16 @@
   BOOST_CHECK_NO_THROW(certCache.insert(cert));
   BOOST_CHECK(certCache.find(cert.getName()) != nullptr);
 
-  advanceClocks(time::seconds(11), 1);
+  advanceClocks(11_s, 1);
   BOOST_CHECK(certCache.find(cert.getName()) == nullptr);
 
   BOOST_CHECK_NO_THROW(certCache.insert(cert));
   BOOST_CHECK(certCache.find(cert.getName()) != nullptr);
 
-  advanceClocks(time::seconds(5));
+  advanceClocks(5_s);
   BOOST_CHECK(certCache.find(cert.getName()) != nullptr);
 
-  advanceClocks(time::seconds(15));
+  advanceClocks(15_s);
   BOOST_CHECK(certCache.find(cert.getName()) == nullptr);
 }
 
@@ -79,7 +79,7 @@
   BOOST_CHECK(certCache.find(Interest(cert.getKeyName())) != nullptr);
   BOOST_CHECK(certCache.find(Interest(Name(cert.getName()).appendVersion())) == nullptr);
 
-  advanceClocks(time::seconds(12));
+  advanceClocks(12_s);
   BOOST_CHECK(certCache.find(Interest(cert.getIdentity())) == nullptr);
 
   Certificate cert3 = addCertificate(identity.getDefaultKey(), "3");
diff --git a/tests/unit-tests/security/v2/certificate-fetcher-from-network.t.cpp b/tests/unit-tests/security/v2/certificate-fetcher-from-network.t.cpp
index 0caa12f..e4b1ec9 100644
--- a/tests/unit-tests/security/v2/certificate-fetcher-from-network.t.cpp
+++ b/tests/unit-tests/security/v2/certificate-fetcher-from-network.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -110,7 +110,7 @@
   BOOST_CHECK_EQUAL(this->face.sentInterests.size(), 2);
   this->face.sentInterests.clear();
 
-  this->advanceClocks(time::hours(1), 2); // expire validator caches
+  this->advanceClocks(1_h, 2); // expire validator caches
 
   VALIDATE_SUCCESS(this->interest, "Should get accepted, as interests bring certs");
   BOOST_CHECK_EQUAL(this->face.sentInterests.size(), 2);
@@ -122,7 +122,7 @@
   BOOST_CHECK_GT(this->face.sentInterests.size(), 2);
   this->face.sentInterests.clear();
 
-  this->advanceClocks(time::hours(1), 2); // expire validator caches
+  this->advanceClocks(1_h, 2); // expire validator caches
 
   VALIDATE_FAILURE(this->interest, "Should fail, as interests don't bring data");
   BOOST_CHECK_GT(this->face.sentInterests.size(), 2);
diff --git a/tests/unit-tests/security/v2/certificate.t.cpp b/tests/unit-tests/security/v2/certificate.t.cpp
index 9522b55..5e0e24f 100644
--- a/tests/unit-tests/security/v2/certificate.t.cpp
+++ b/tests/unit-tests/security/v2/certificate.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -171,7 +171,7 @@
 {
   Certificate certificate;
   certificate.setName("/ndn/site1/KEY/ksk-1416425377094/0123/%FD%00%00%01I%C9%8B");
-  certificate.setFreshnessPeriod(time::seconds(3600));
+  certificate.setFreshnessPeriod(1_h);
   certificate.setContent(PUBLIC_KEY, sizeof(PUBLIC_KEY));
   certificate.setSignature(generateFakeSignature());
 
@@ -191,7 +191,7 @@
 {
   Certificate certificate;
   certificate.setName("/ndn/site1/KEY/ksk-1416425377094/0123/%FD%00%00%01I%C9%8B");
-  certificate.setFreshnessPeriod(time::seconds(3600));
+  certificate.setFreshnessPeriod(1_h);
   certificate.setContent(PUBLIC_KEY, sizeof(PUBLIC_KEY));
   certificate.setSignature(generateFakeSignature());
 
diff --git a/tests/unit-tests/security/v2/key-chain.t.cpp b/tests/unit-tests/security/v2/key-chain.t.cpp
index 9575754..d03f572 100644
--- a/tests/unit-tests/security/v2/key-chain.t.cpp
+++ b/tests/unit-tests/security/v2/key-chain.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -396,9 +396,8 @@
                        .getDefaultKey()
                        .getDefaultCertificate();
   BOOST_CHECK(cert.isValid());
-  BOOST_CHECK(cert.isValid(time::system_clock::now() + time::days(10 * 365)));
-  BOOST_CHECK_GT(cert.getValidityPeriod().getPeriod().second,
-                 time::system_clock::now() + time::days(10 * 365));
+  BOOST_CHECK(cert.isValid(time::system_clock::now() + 10 * 365_days));
+  BOOST_CHECK_GT(cert.getValidityPeriod().getPeriod().second, time::system_clock::now() + 10 * 365_days);
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestKeyChain
diff --git a/tests/unit-tests/security/v2/trust-anchor-container.t.cpp b/tests/unit-tests/security/v2/trust-anchor-container.t.cpp
index 0efecdc..30749ac 100644
--- a/tests/unit-tests/security/v2/trust-anchor-container.t.cpp
+++ b/tests/unit-tests/security/v2/trust-anchor-container.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -20,10 +20,11 @@
  */
 
 #include "security/v2/trust-anchor-container.hpp"
+#include "util/io.hpp"
 
 #include "../../identity-management-time-fixture.hpp"
-#include "util/io.hpp"
 #include "boost-test.hpp"
+
 #include <boost/filesystem.hpp>
 
 namespace ndn {
@@ -97,21 +98,21 @@
   BOOST_CHECK_NO_THROW(anchorContainer.insert("group1", Certificate(cert1)));
   BOOST_CHECK_EQUAL(cert, anchorContainer.find(cert1.getName())); // still the same instance of the certificate
   // cannot add dynamic group when static already exists
-  BOOST_CHECK_THROW(anchorContainer.insert("group1", certPath1.string(), time::seconds(1)), TrustAnchorContainer::Error);
+  BOOST_CHECK_THROW(anchorContainer.insert("group1", certPath1.string(), 1_s), TrustAnchorContainer::Error);
   BOOST_CHECK_EQUAL(anchorContainer.getGroup("group1").size(), 1);
   BOOST_CHECK_EQUAL(anchorContainer.size(), 1);
 
   // From file
-  anchorContainer.insert("group2", certPath2.string(), time::seconds(1));
+  anchorContainer.insert("group2", certPath2.string(), 1_s);
   BOOST_CHECK(anchorContainer.find(cert2.getName()) != nullptr);
   BOOST_CHECK(anchorContainer.find(identity2.getName()) != nullptr);
   BOOST_CHECK_THROW(anchorContainer.insert("group2", Certificate(cert2)), TrustAnchorContainer::Error);
-  BOOST_CHECK_THROW(anchorContainer.insert("group2", certPath2.string(), time::seconds(1)), TrustAnchorContainer::Error);
+  BOOST_CHECK_THROW(anchorContainer.insert("group2", certPath2.string(), 1_s), TrustAnchorContainer::Error);
   BOOST_CHECK_EQUAL(anchorContainer.getGroup("group2").size(), 1);
   BOOST_CHECK_EQUAL(anchorContainer.size(), 2);
 
   boost::filesystem::remove(certPath2);
-  advanceClocks(time::seconds(1), 11);
+  advanceClocks(1_s, 11);
 
   BOOST_CHECK(anchorContainer.find(identity2.getName()) == nullptr);
   BOOST_CHECK(anchorContainer.find(cert2.getName()) == nullptr);
@@ -133,7 +134,7 @@
 {
   boost::filesystem::remove(certPath2);
 
-  anchorContainer.insert("group", certDirPath.string(), time::seconds(1), true /* isDir */);
+  anchorContainer.insert("group", certDirPath.string(), 1_s, true /* isDir */);
 
   BOOST_CHECK(anchorContainer.find(identity1.getName()) != nullptr);
   BOOST_CHECK(anchorContainer.find(identity2.getName()) == nullptr);
@@ -141,7 +142,7 @@
 
   saveCertToFile(cert2, certPath2.string());
 
-  advanceClocks(time::milliseconds(100), 11);
+  advanceClocks(100_ms, 11);
 
   BOOST_CHECK(anchorContainer.find(identity1.getName()) != nullptr);
   BOOST_CHECK(anchorContainer.find(identity2.getName()) != nullptr);
@@ -149,7 +150,7 @@
 
   boost::filesystem::remove_all(certDirPath);
 
-  advanceClocks(time::milliseconds(100), 11);
+  advanceClocks(100_ms, 11);
 
   BOOST_CHECK(anchorContainer.find(identity1.getName()) == nullptr);
   BOOST_CHECK(anchorContainer.find(identity2.getName()) == nullptr);
@@ -158,7 +159,7 @@
 
 BOOST_FIXTURE_TEST_CASE(FindByInterest, AnchorContainerTestFixture)
 {
-  anchorContainer.insert("group1", certPath1.string(), time::seconds(1));
+  anchorContainer.insert("group1", certPath1.string(), 1_s);
   Interest interest(identity1.getName());
   BOOST_CHECK(anchorContainer.find(interest) != nullptr);
   Interest interest1(identity1.getName().getPrefix(-1));
diff --git a/tests/unit-tests/security/v2/validation-policy-command-interest.t.cpp b/tests/unit-tests/security/v2/validation-policy-command-interest.t.cpp
index dd400b4..4a3365c 100644
--- a/tests/unit-tests/security/v2/validation-policy-command-interest.t.cpp
+++ b/tests/unit-tests/security/v2/validation-policy-command-interest.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -91,7 +91,7 @@
   auto i1 = makeCommandInterest(identity);
   VALIDATE_SUCCESS(i1, "Should succeed (within grace period)");
 
-  advanceClocks(time::milliseconds(5));
+  advanceClocks(5_ms);
   auto i2 = makeCommandInterest(identity);
   VALIDATE_SUCCESS(i2, "Should succeed (timestamp larger than previous)");
 }
@@ -173,7 +173,7 @@
   getOptions()
   {
     ValidationPolicyCommandInterest::Options options;
-    options.gracePeriod = time::seconds(15);
+    options.gracePeriod = 15_s;
     return options;
   }
 };
@@ -181,7 +181,7 @@
 BOOST_FIXTURE_TEST_CASE(TimestampOutOfGracePositive, ValidationPolicyCommandInterestFixture<GracePeriod15Sec>)
 {
   auto i1 = makeCommandInterest(identity); // signed at 0s
-  advanceClocks(time::seconds(16)); // verifying at +16s
+  advanceClocks(16_s); // verifying at +16s
   VALIDATE_FAILURE(i1, "Should fail (timestamp outside the grace period)");
   rewindClockAfterValidation();
 
@@ -192,12 +192,12 @@
 BOOST_FIXTURE_TEST_CASE(TimestampOutOfGraceNegative, ValidationPolicyCommandInterestFixture<GracePeriod15Sec>)
 {
   auto i1 = makeCommandInterest(identity); // signed at 0s
-  advanceClocks(time::seconds(1));
+  advanceClocks(1_s);
   auto i2 = makeCommandInterest(identity); // signed at +1s
-  advanceClocks(time::seconds(1));
+  advanceClocks(1_s);
   auto i3 = makeCommandInterest(identity); // signed at +2s
 
-  systemClock->advance(time::seconds(-18)); // verifying at -16s
+  systemClock->advance(-18_s); // verifying at -16s
   VALIDATE_FAILURE(i1, "Should fail (timestamp outside the grace period)");
   rewindClockAfterValidation();
 
@@ -206,7 +206,7 @@
   rewindClockAfterValidation();
 
   // CommandInterestValidator should not remember i2's timestamp, and should treat i3 as initial
-  advanceClocks(time::seconds(18)); // verifying at +2s
+  advanceClocks(18_s); // verifying at +2s
   VALIDATE_SUCCESS(i3, "Should succeed");
 }
 
@@ -220,7 +220,7 @@
                    i1.getName()[command_interest::POS_TIMESTAMP]);
   VALIDATE_FAILURE(i2, "Should fail (timestamp reordered)");
 
-  advanceClocks(time::seconds(2));
+  advanceClocks(2_s);
   auto i3 = makeCommandInterest(identity); // signed at +2s
   VALIDATE_SUCCESS(i3, "Should succeed");
 }
@@ -228,27 +228,27 @@
 BOOST_AUTO_TEST_CASE(TimestampReorderNegative)
 {
   auto i2 = makeCommandInterest(identity); // signed at 0ms
-  advanceClocks(time::milliseconds(200));
+  advanceClocks(200_ms);
   auto i3 = makeCommandInterest(identity); // signed at +200ms
-  advanceClocks(time::milliseconds(900));
+  advanceClocks(900_ms);
   auto i1 = makeCommandInterest(identity); // signed at +1100ms
-  advanceClocks(time::milliseconds(300));
+  advanceClocks(300_ms);
   auto i4 = makeCommandInterest(identity); // signed at +1400ms
 
-  systemClock->advance(time::milliseconds(-300)); // verifying at +1100ms
+  systemClock->advance(-300_ms); // verifying at +1100ms
   VALIDATE_SUCCESS(i1, "Should succeed");
   rewindClockAfterValidation();
 
-  systemClock->advance(time::milliseconds(-1100)); // verifying at 0ms
+  systemClock->advance(-1100_ms); // verifying at 0ms
   VALIDATE_FAILURE(i2, "Should fail (timestamp reordered)");
   rewindClockAfterValidation();
 
   // CommandInterestValidator should not remember i2's timestamp
-  advanceClocks(time::milliseconds(200)); // verifying at +200ms
+  advanceClocks(200_ms); // verifying at +200ms
   VALIDATE_FAILURE(i3, "Should fail (timestamp reordered)");
   rewindClockAfterValidation();
 
-  advanceClocks(time::milliseconds(1200)); // verifying at 1400ms
+  advanceClocks(1200_ms); // verifying at 1400ms
   VALIDATE_SUCCESS(i4, "Should succeed");
 }
 
@@ -287,7 +287,7 @@
   VALIDATE_SUCCESS(i1, "Should succeed when validating at 0ms");
   this->rewindClockAfterValidation();
 
-  this->advanceClocks(time::milliseconds(1));
+  this->advanceClocks(1_ms);
   VALIDATE_FAILURE(i2, "Should fail when validating at 1ms");
 }
 
@@ -298,7 +298,7 @@
   getOptions()
   {
     ValidationPolicyCommandInterest::Options options;
-    options.gracePeriod = time::seconds(15);
+    options.gracePeriod = 15_s;
     options.maxRecords = 3;
     return options;
   }
@@ -319,9 +319,9 @@
   auto i2 = makeCommandInterest(id3);
   auto i3 = makeCommandInterest(id4);
   auto i00 = makeCommandInterest(id1); // signed at 0s
-  advanceClocks(time::seconds(1));
+  advanceClocks(1_s);
   auto i01 = makeCommandInterest(id1); // signed at 1s
-  advanceClocks(time::seconds(1));
+  advanceClocks(1_s);
   auto i02 = makeCommandInterest(id1); // signed at 2s
 
   VALIDATE_SUCCESS(i00, "Should succeed");
@@ -349,7 +349,7 @@
   getOptions()
   {
     ValidationPolicyCommandInterest::Options options;
-    options.gracePeriod = time::seconds(15);
+    options.gracePeriod = 15_s;
     options.maxRecords = -1;
     return options;
   }
@@ -365,7 +365,7 @@
   }
 
   auto i1 = makeCommandInterest(identities.at(0)); // signed at 0s
-  advanceClocks(time::seconds(1));
+  advanceClocks(1_s);
   for (int i = 0; i < 20; ++i) {
     auto i2 = makeCommandInterest(identities.at(i)); // signed at +1s
 
@@ -382,7 +382,7 @@
   getOptions()
   {
     ValidationPolicyCommandInterest::Options options;
-    options.gracePeriod = time::seconds(15);
+    options.gracePeriod = 15_s;
     options.maxRecords = 0;
     return options;
   }
@@ -391,7 +391,7 @@
 BOOST_FIXTURE_TEST_CASE(ZeroRecords, ValidationPolicyCommandInterestFixture<ZeroRecordsOptions>)
 {
   auto i1 = makeCommandInterest(identity); // signed at 0s
-  advanceClocks(time::seconds(1));
+  advanceClocks(1_s);
   auto i2 = makeCommandInterest(identity); // signed at +1s
   VALIDATE_SUCCESS(i2, "Should succeed");
   rewindClockAfterValidation();
@@ -406,8 +406,8 @@
   getOptions()
   {
     ValidationPolicyCommandInterest::Options options;
-    options.gracePeriod = time::seconds(400);
-    options.recordLifetime = time::seconds(300);
+    options.gracePeriod = 400_s;
+    options.recordLifetime = 300_s;
     return options;
   }
 };
@@ -415,19 +415,19 @@
 BOOST_FIXTURE_TEST_CASE(LimitedRecordLifetime, ValidationPolicyCommandInterestFixture<LimitedRecordLifetimeOptions>)
 {
   auto i1 = makeCommandInterest(identity); // signed at 0s
-  advanceClocks(time::seconds(240));
+  advanceClocks(240_s);
   auto i2 = makeCommandInterest(identity); // signed at +240s
-  advanceClocks(time::seconds(120));
+  advanceClocks(120_s);
   auto i3 = makeCommandInterest(identity); // signed at +360s
 
-  systemClock->advance(time::seconds(-360)); // rewind system clock to 0s
+  systemClock->advance(-360_s); // rewind system clock to 0s
   VALIDATE_SUCCESS(i1, "Should succeed");
   rewindClockAfterValidation();
 
   VALIDATE_SUCCESS(i3, "Should succeed");
   rewindClockAfterValidation();
 
-  advanceClocks(time::seconds(30), time::seconds(301)); // advance steady clock by 301s, and system clock to +301s
+  advanceClocks(30_s, 301_s); // advance steady clock by 301s, and system clock to +301s
   VALIDATE_SUCCESS(i2, "Should succeed despite timestamp is reordered, because record has been expired");
 }
 
@@ -438,7 +438,7 @@
   getOptions()
   {
     ValidationPolicyCommandInterest::Options options;
-    options.gracePeriod = time::seconds(15);
+    options.gracePeriod = 15_s;
     options.recordLifetime = time::seconds::zero();
     return options;
   }
@@ -447,7 +447,7 @@
 BOOST_FIXTURE_TEST_CASE(ZeroRecordLifetime, ValidationPolicyCommandInterestFixture<ZeroRecordLifetimeOptions>)
 {
   auto i1 = makeCommandInterest(identity); // signed at 0s
-  advanceClocks(time::seconds(1));
+  advanceClocks(1_s);
   auto i2 = makeCommandInterest(identity); // signed at +1s
   VALIDATE_SUCCESS(i2, "Should succeed");
   rewindClockAfterValidation();
diff --git a/tests/unit-tests/security/v2/validation-policy-config.t.cpp b/tests/unit-tests/security/v2/validation-policy-config.t.cpp
index 7808700..31cba27 100644
--- a/tests/unit-tests/security/v2/validation-policy-config.t.cpp
+++ b/tests/unit-tests/security/v2/validation-policy-config.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -232,7 +232,7 @@
   static time::milliseconds
   getRefreshTime()
   {
-    return time::hours(1);
+    return 1_h;
   }
 };
 
@@ -248,7 +248,7 @@
   static time::milliseconds
   getRefreshTime()
   {
-    return time::minutes(1);
+    return 1_min;
   }
 };
 
@@ -264,7 +264,7 @@
   static time::milliseconds
   getRefreshTime()
   {
-    return time::seconds(1);
+    return 1_s;
   }
 };
 
diff --git a/tests/unit-tests/security/v2/validator-fixture.hpp b/tests/unit-tests/security/v2/validator-fixture.hpp
index 7f52048..c9a5763 100644
--- a/tests/unit-tests/security/v2/validator-fixture.hpp
+++ b/tests/unit-tests/security/v2/validator-fixture.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -43,7 +43,7 @@
     : face(io, {true, true})
     , validator(make_unique<ValidationPolicy>(), make_unique<CertificateFetcher>(face))
     , policy(static_cast<ValidationPolicy&>(validator.getPolicy()))
-    , cache(time::days(100))
+    , cache(100_days)
   {
     processInterest = [this] (const Interest& interest) {
       auto cert = cache.find(interest);
diff --git a/tests/unit-tests/security/v2/validator.t.cpp b/tests/unit-tests/security/v2/validator.t.cpp
index ac5ca86..af64557 100644
--- a/tests/unit-tests/security/v2/validator.t.cpp
+++ b/tests/unit-tests/security/v2/validator.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -104,8 +104,8 @@
 {
   Data expiredCert = subIdentity.getDefaultKey().getDefaultCertificate();
   SignatureInfo info;
-  info.setValidityPeriod(ValidityPeriod(time::system_clock::now() - time::hours(2),
-                                        time::system_clock::now() - time::hours(1)));
+  info.setValidityPeriod(ValidityPeriod(time::system_clock::now() - 2_h,
+                                        time::system_clock::now() - 1_h));
   m_keyChain.sign(expiredCert, signingByIdentity(identity).setSignatureInfo(info));
   BOOST_REQUIRE_NO_THROW(Certificate(expiredCert.wireEncode()));
 
@@ -150,7 +150,7 @@
   BOOST_CHECK_EQUAL(face.sentInterests.size(), 0);
   face.sentInterests.clear();
 
-  advanceClocks(time::hours(1), 2); // expire trusted cache
+  advanceClocks(1_h, 2); // expire trusted cache
 
   VALIDATE_FAILURE(data, "Should try and fail to retrieve certs");
   BOOST_CHECK_GT(face.sentInterests.size(), 1);
@@ -187,7 +187,7 @@
   BOOST_CHECK_EQUAL(face.sentInterests.size(), 0);
   face.sentInterests.clear();
 
-  advanceClocks(time::minutes(10), 2); // expire untrusted cache
+  advanceClocks(10_min, 2); // expire untrusted cache
 
   VALIDATE_FAILURE(data, "Should try and fail to retrieve certs");
   BOOST_CHECK_GT(face.sentInterests.size(), 1);
@@ -246,7 +246,7 @@
   BOOST_CHECK_EQUAL(face.sentInterests.size(), 0);
   face.sentInterests.clear();
 
-  advanceClocks(time::hours(1), 2); // expire trusted cache
+  advanceClocks(1_h, 2); // expire trusted cache
 
   m_keyChain.sign(interest, signingByIdentity(subSelfSignedIdentity));
   m_keyChain.sign(data, signingByIdentity(subSelfSignedIdentity));
@@ -272,15 +272,15 @@
 
     // set metainfo
     certificate.setContentType(tlv::ContentType_Key);
-    certificate.setFreshnessPeriod(time::hours(1));
+    certificate.setFreshnessPeriod(1_h);
 
     // set content
     certificate.setContent(requestedKey.getPublicKey().data(), requestedKey.getPublicKey().size());
 
     // set signature-info
     SignatureInfo info;
-    info.setValidityPeriod(security::ValidityPeriod(time::system_clock::now() - time::days(10),
-                                                    time::system_clock::now() + time::days(10)));
+    info.setValidityPeriod(security::ValidityPeriod(time::system_clock::now() - 10_days,
+                                                    time::system_clock::now() + 10_days));
 
     m_keyChain.sign(certificate, signingByKey(parentKey).setSignatureInfo(info));
     face.receive(certificate);
@@ -295,7 +295,7 @@
   BOOST_CHECK_EQUAL(face.sentInterests.size(), 40);
   face.sentInterests.clear();
 
-  advanceClocks(time::hours(1), 5); // expire caches
+  advanceClocks(1_h, 5); // expire caches
 
   validator.setMaxDepth(30);
   BOOST_CHECK_EQUAL(validator.getMaxDepth(), 30);
@@ -315,8 +315,8 @@
     request.setName(Name(key.getName()).append("looper").appendVersion());
 
     SignatureInfo info;
-    info.setValidityPeriod({time::system_clock::now() - time::days(100),
-                            time::system_clock::now() + time::days(100)});
+    info.setValidityPeriod({time::system_clock::now() - 100_days,
+                            time::system_clock::now() + 100_days});
     m_keyChain.sign(request, signingByKey(signer).setSignatureInfo(info));
     m_keyChain.addCertificate(key, request);
 
diff --git a/tests/unit-tests/security/validity-period.t.cpp b/tests/unit-tests/security/validity-period.t.cpp
index 1fc91cd..4c6fb6b 100644
--- a/tests/unit-tests/security/validity-period.t.cpp
+++ b/tests/unit-tests/security/validity-period.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2016 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -38,22 +38,20 @@
 {
   time::system_clock::TimePoint now = this->systemClock->getNow();
 
-  time::system_clock::TimePoint notBefore = now - time::days(1);
-  time::system_clock::TimePoint notAfter = notBefore + time::days(2);
+  time::system_clock::TimePoint notBefore = now - 1_day;
+  time::system_clock::TimePoint notAfter = notBefore + 2_days;
 
   ValidityPeriod validity1 = ValidityPeriod(notBefore, notAfter);
 
   auto period = validity1.getPeriod();
   BOOST_CHECK_GE(period.first, notBefore); // fractional seconds will be removed
-  BOOST_CHECK_LT(period.first, notBefore + time::seconds(1));
+  BOOST_CHECK_LT(period.first, notBefore + 1_s);
 
   BOOST_CHECK_LE(period.second, notAfter); // fractional seconds will be removed
-  BOOST_CHECK_GT(period.second, notAfter - time::seconds(1));
+  BOOST_CHECK_GT(period.second, notAfter - 1_s);
   BOOST_CHECK_EQUAL(validity1.isValid(), true);
 
-  BOOST_CHECK_EQUAL(ValidityPeriod(now - time::days(2),
-                                   now - time::days(1)).isValid(),
-                    false);
+  BOOST_CHECK_EQUAL(ValidityPeriod(now - 2_days, now - 1_day).isValid(), false);
 
   BOOST_CHECK_NO_THROW((ValidityPeriod()));
   ValidityPeriod validity2;
@@ -63,17 +61,17 @@
   BOOST_CHECK(validity2.getPeriod() != std::make_pair(time::getUnixEpoch(), time::getUnixEpoch()));
   BOOST_CHECK_EQUAL(validity2, validity1);
 
-  validity1.setPeriod(time::getUnixEpoch(), time::getUnixEpoch() + time::days(10 * 365));
+  validity1.setPeriod(time::getUnixEpoch(), time::getUnixEpoch() + 10 * 365_days);
   BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(validity1),
                     "(19700101T000000, 19791230T000000)");
 
-  validity1.setPeriod(time::getUnixEpoch() + time::nanoseconds(1),
-                      time::getUnixEpoch() + time::days(10 * 365) + time::nanoseconds(1));
+  validity1.setPeriod(time::getUnixEpoch() + 1_ns,
+                      time::getUnixEpoch() + (10 * 365_days) + 1_ns);
   BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(validity1),
                     "(19700101T000001, 19791230T000000)");
 
   BOOST_CHECK_EQUAL(ValidityPeriod(now, now).isValid(), true);
-  BOOST_CHECK_EQUAL(ValidityPeriod(now + time::seconds(1), now).isValid(), false);
+  BOOST_CHECK_EQUAL(ValidityPeriod(now + 1_s, now).isValid(), false);
 }
 
 const uint8_t VP1[] = {
@@ -89,7 +87,7 @@
 BOOST_AUTO_TEST_CASE(EncodingDecoding)
 {
   time::system_clock::TimePoint notBefore = time::getUnixEpoch();
-  time::system_clock::TimePoint notAfter = notBefore + time::days(1);
+  time::system_clock::TimePoint notAfter = notBefore + 1_day;
 
   ValidityPeriod v1(notBefore, notAfter);
 
@@ -182,8 +180,8 @@
 BOOST_AUTO_TEST_CASE(Comparison)
 {
   time::system_clock::TimePoint notBefore = time::getUnixEpoch();
-  time::system_clock::TimePoint notAfter = notBefore + time::days(1);
-  time::system_clock::TimePoint notAfter2 = notBefore + time::days(2);
+  time::system_clock::TimePoint notAfter = notBefore + 1_day;
+  time::system_clock::TimePoint notAfter2 = notBefore + 2_days;
 
   ValidityPeriod validity1(notBefore, notAfter);
   ValidityPeriod validity2(notBefore, notAfter);
diff --git a/tests/unit-tests/signature-info.t.cpp b/tests/unit-tests/signature-info.t.cpp
index 9ca9cff..836c114 100644
--- a/tests/unit-tests/signature-info.t.cpp
+++ b/tests/unit-tests/signature-info.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -186,7 +186,7 @@
   };
 
   time::system_clock::TimePoint notBefore = time::getUnixEpoch();
-  time::system_clock::TimePoint notAfter = notBefore + time::days(1);
+  time::system_clock::TimePoint notAfter = notBefore + 1_day;
   security::ValidityPeriod vp1(notBefore, notAfter);
 
   // encode
diff --git a/tests/unit-tests/util/dummy-client-face.t.cpp b/tests/unit-tests/util/dummy-client-face.t.cpp
index 8469d59..5308e28 100644
--- a/tests/unit-tests/util/dummy-client-face.t.cpp
+++ b/tests/unit-tests/util/dummy-client-face.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -37,11 +37,11 @@
   bool isOverrideInvoked = false;
   auto override = [&] (time::milliseconds timeout) {
     isOverrideInvoked = true;
-    BOOST_CHECK_EQUAL(timeout, time::milliseconds(200));
+    BOOST_CHECK_EQUAL(timeout, 200_ms);
   };
 
   DummyClientFace face(io, {false, false, override});
-  face.processEvents(time::milliseconds(200));
+  face.processEvents(200_ms);
   BOOST_CHECK(isOverrideInvoked);
 }
 
@@ -67,7 +67,7 @@
                             return;
                           }, nullptr, nullptr);
 
-  advanceClocks(time::milliseconds(25), 4);
+  advanceClocks(25_ms, 4);
 
   int nFace1Data = 0;
   int nFace2Nack = 0;
@@ -85,7 +85,7 @@
                           nFace2Nack++;
                         }, nullptr);
 
-  advanceClocks(time::milliseconds(10), 100);
+  advanceClocks(10_ms, 100);
 
   BOOST_CHECK_EQUAL(nFace1Data, 1);
   BOOST_CHECK_EQUAL(nFace2Nack, 1);
diff --git a/tests/unit-tests/util/notification-stream.t.cpp b/tests/unit-tests/util/notification-stream.t.cpp
index faedec8..3721091 100644
--- a/tests/unit-tests/util/notification-stream.t.cpp
+++ b/tests/unit-tests/util/notification-stream.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2017 Regents of the University of California,
+/*
+ * Copyright (c) 2014-2018 Regents of the University of California,
  *                         Arizona Board of Regents,
  *                         Colorado State University,
  *                         University Pierre & Marie Curie, Sorbonne University,
@@ -26,10 +26,10 @@
  */
 
 #include "util/notification-stream.hpp"
-#include "simple-notification.hpp"
 #include "util/dummy-client-face.hpp"
 
 #include "boost-test.hpp"
+#include "simple-notification.hpp"
 #include "../identity-management-time-fixture.hpp"
 
 namespace ndn {
@@ -48,11 +48,10 @@
   SimpleNotification event1("msg1");
   notificationStream.postNotification(event1);
 
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
 
   BOOST_REQUIRE_EQUAL(face.sentData.size(), 1);
-  BOOST_CHECK_EQUAL(face.sentData[0].getName(),
-                    "/localhost/nfd/NotificationStreamTest/%FE%00");
+  BOOST_CHECK_EQUAL(face.sentData[0].getName(), "/localhost/nfd/NotificationStreamTest/%FE%00");
   SimpleNotification decoded1;
   BOOST_CHECK_NO_THROW(decoded1.wireDecode(face.sentData[0].getContent().blockFromValue()));
   BOOST_CHECK_EQUAL(decoded1.getMessage(), "msg1");
@@ -60,11 +59,10 @@
   SimpleNotification event2("msg2");
   notificationStream.postNotification(event2);
 
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
 
   BOOST_REQUIRE_EQUAL(face.sentData.size(), 2);
-  BOOST_CHECK_EQUAL(face.sentData[1].getName(),
-                    "/localhost/nfd/NotificationStreamTest/%FE%01");
+  BOOST_CHECK_EQUAL(face.sentData[1].getName(), "/localhost/nfd/NotificationStreamTest/%FE%01");
   SimpleNotification decoded2;
   BOOST_CHECK_NO_THROW(decoded2.wireDecode(face.sentData[1].getContent().blockFromValue()));
   BOOST_CHECK_EQUAL(decoded2.getMessage(), "msg2");
diff --git a/tests/unit-tests/util/notification-subscriber.t.cpp b/tests/unit-tests/util/notification-subscriber.t.cpp
index aef46a3..3fe3fd6 100644
--- a/tests/unit-tests/util/notification-subscriber.t.cpp
+++ b/tests/unit-tests/util/notification-subscriber.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2017 Regents of the University of California,
+ * Copyright (c) 2014-2018 Regents of the University of California,
  *                         Arizona Board of Regents,
  *                         Colorado State University,
  *                         University Pierre & Marie Curie, Sorbonne University,
@@ -45,7 +45,7 @@
   NotificationSubscriberFixture()
     : streamPrefix("ndn:/NotificationSubscriberTest")
     , subscriberFace(io, m_keyChain)
-    , subscriber(subscriberFace, streamPrefix, time::seconds(1))
+    , subscriber(subscriberFace, streamPrefix, 1_s)
     , nextSendNotificationNo(0)
   {
   }
@@ -61,7 +61,7 @@
     dataName.appendSequenceNumber(nextSendNotificationNo);
     Data data(dataName);
     data.setContent(notification.wireEncode());
-    data.setFreshnessPeriod(time::seconds(1));
+    data.setFreshnessPeriod(1_s);
     m_keyChain.sign(data);
 
     lastDeliveredSeqNo = nextSendNotificationNo;
@@ -185,7 +185,7 @@
   this->connectHandlers();
   subscriber.start();
   BOOST_REQUIRE_EQUAL(subscriber.isRunning(), true);
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   BOOST_CHECK(this->hasInitialRequest());
 
   subscriberFace.sentInterests.clear();
@@ -198,19 +198,19 @@
 {
   this->connectHandlers();
   subscriber.start();
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
 
   // respond to initial request
   subscriberFace.sentInterests.clear();
   this->deliverNotification("n1");
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(lastNotification.getMessage(), "n1");
   BOOST_CHECK_EQUAL(this->getRequestSeqNo(), lastDeliveredSeqNo + 1);
 
   // respond to continuation request
   subscriberFace.sentInterests.clear();
   this->deliverNotification("n2");
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(lastNotification.getMessage(), "n2");
   BOOST_CHECK_EQUAL(this->getRequestSeqNo(), lastDeliveredSeqNo + 1);
 }
@@ -219,17 +219,17 @@
 {
   this->connectHandlers();
   subscriber.start();
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
 
   // send the first Nack to initial request
   BOOST_REQUIRE_EQUAL(subscriberFace.sentInterests.size(), 1);
   Interest interest = subscriberFace.sentInterests[0];
   subscriberFace.sentInterests.clear();
   this->deliverNack(interest, lp::NackReason::CONGESTION);
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(lastNack.getReason(), lp::NackReason::CONGESTION);
   BOOST_REQUIRE_EQUAL(this->hasInitialRequest(), false);
-  advanceClocks(time::milliseconds(300));
+  advanceClocks(300_ms);
   BOOST_REQUIRE_EQUAL(this->hasInitialRequest(), true);
 
   // send the second Nack to initial request
@@ -237,25 +237,25 @@
   interest = subscriberFace.sentInterests[0];
   subscriberFace.sentInterests.clear();
   this->deliverNack(interest, lp::NackReason::CONGESTION);
-  advanceClocks(time::milliseconds(301));
+  advanceClocks(301_ms);
   BOOST_REQUIRE_EQUAL(this->hasInitialRequest(), false);
-  advanceClocks(time::milliseconds(200));
+  advanceClocks(200_ms);
   BOOST_REQUIRE_EQUAL(this->hasInitialRequest(), true);
 
   // send a notification to initial request
   subscriberFace.sentInterests.clear();
   this->deliverNotification("n1");
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
 
   // send a Nack to subsequent request
   BOOST_REQUIRE_EQUAL(subscriberFace.sentInterests.size(), 1);
   interest = subscriberFace.sentInterests[0];
   subscriberFace.sentInterests.clear();
   this->deliverNack(interest, lp::NackReason::CONGESTION);
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(lastNack.getReason(), lp::NackReason::CONGESTION);
   BOOST_REQUIRE_EQUAL(this->hasInitialRequest(), false);
-  advanceClocks(time::milliseconds(300));
+  advanceClocks(300_ms);
   BOOST_REQUIRE_EQUAL(this->hasInitialRequest(), true);
 }
 
@@ -263,7 +263,7 @@
 {
   this->connectHandlers();
   subscriber.start();
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
 
   subscriberFace.sentInterests.clear();
   lastNotification.setMessage("");
@@ -274,7 +274,7 @@
 
   subscriberFace.sentInterests.clear();
   this->deliverNotification("n1");
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   BOOST_CHECK_EQUAL(lastNotification.getMessage(), "n1");
 }
 
@@ -282,7 +282,7 @@
 {
   this->connectHandlers();
   subscriber.start();
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
 
   Name wrongName = streamPrefix;
   wrongName.append("%07%07");
@@ -291,7 +291,7 @@
   subscriberFace.receive(wrongData);
   subscriberFace.sentInterests.clear();
   lastNotification.setMessage("");
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   BOOST_CHECK(lastNotification.getMessage().empty());
   BOOST_CHECK_EQUAL(lastDecodeErrorData.getName(), wrongName);
   BOOST_CHECK(this->hasInitialRequest());
@@ -301,12 +301,12 @@
 {
   this->connectHandlers();
   subscriber.start();
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
 
   subscriberFace.sentInterests.clear();
   lastNotification.setMessage("");
   this->deliverNotification("\x07n4");
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   BOOST_CHECK(lastNotification.getMessage().empty());
   BOOST_CHECK(this->hasInitialRequest());
 }
diff --git a/tests/unit-tests/util/scheduler.t.cpp b/tests/unit-tests/util/scheduler.t.cpp
index 8189f01..de54800 100644
--- a/tests/unit-tests/util/scheduler.t.cpp
+++ b/tests/unit-tests/util/scheduler.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2016 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -55,27 +55,27 @@
   size_t count1 = 0;
   size_t count2 = 0;
 
-  scheduler.scheduleEvent(time::milliseconds(500), [&] {
+  scheduler.scheduleEvent(500_ms, [&] {
       ++count1;
       BOOST_CHECK_EQUAL(count2, 1);
     });
 
-  EventId i = scheduler.scheduleEvent(time::seconds(1), [&] {
+  EventId i = scheduler.scheduleEvent(1_s, [&] {
       BOOST_ERROR("This event should not have been fired");
     });
   scheduler.cancelEvent(i);
 
-  scheduler.scheduleEvent(time::milliseconds(250), [&] {
+  scheduler.scheduleEvent(250_ms, [&] {
       BOOST_CHECK_EQUAL(count1, 0);
       ++count2;
     });
 
-  i = scheduler.scheduleEvent(time::milliseconds(50), [&] {
+  i = scheduler.scheduleEvent(50_ms, [&] {
       BOOST_ERROR("This event should not have been fired");
     });
   scheduler.cancelEvent(i);
 
-  advanceClocks(time::milliseconds(25), time::milliseconds(1000));
+  advanceClocks(25_ms, 1000_ms);
   BOOST_CHECK_EQUAL(count1, 1);
   BOOST_CHECK_EQUAL(count2, 1);
 }
@@ -85,13 +85,13 @@
   class MyException : public std::exception
   {
   };
-  scheduler.scheduleEvent(time::milliseconds(10), [] { BOOST_THROW_EXCEPTION(MyException()); });
+  scheduler.scheduleEvent(10_ms, [] { BOOST_THROW_EXCEPTION(MyException()); });
 
   bool isCallbackInvoked = false;
-  scheduler.scheduleEvent(time::milliseconds(20), [&isCallbackInvoked] { isCallbackInvoked = true; });
+  scheduler.scheduleEvent(20_ms, [&isCallbackInvoked] { isCallbackInvoked = true; });
 
-  BOOST_CHECK_THROW(this->advanceClocks(time::milliseconds(6), 2), MyException);
-  this->advanceClocks(time::milliseconds(6), 2);
+  BOOST_CHECK_THROW(this->advanceClocks(6_ms, 2), MyException);
+  this->advanceClocks(6_ms, 2);
   BOOST_CHECK(isCallbackInvoked);
 }
 
@@ -107,11 +107,11 @@
 BOOST_AUTO_TEST_CASE(SelfCancel)
 {
   EventId selfEventId;
-  selfEventId = scheduler.scheduleEvent(time::milliseconds(100), [&] {
+  selfEventId = scheduler.scheduleEvent(100_ms, [&] {
       scheduler.cancelEvent(selfEventId);
     });
 
-  BOOST_REQUIRE_NO_THROW(advanceClocks(time::milliseconds(100), 10));
+  BOOST_REQUIRE_NO_THROW(advanceClocks(100_ms, 10));
 }
 
 class SelfRescheduleFixture : public SchedulerFixture
@@ -125,7 +125,7 @@
   void
   reschedule()
   {
-    EventId eventId = scheduler.scheduleEvent(time::milliseconds(100),
+    EventId eventId = scheduler.scheduleEvent(100_ms,
                                               bind(&SelfRescheduleFixture::reschedule, this));
     scheduler.cancelEvent(selfEventId);
     selfEventId = eventId;
@@ -142,7 +142,7 @@
     scheduler.cancelEvent(selfEventId);
 
     if (count < 5)  {
-      selfEventId = scheduler.scheduleEvent(time::milliseconds(100),
+      selfEventId = scheduler.scheduleEvent(100_ms,
                                             bind(&SelfRescheduleFixture::reschedule2, this));
       count++;
     }
@@ -153,12 +153,12 @@
   {
     scheduler.cancelEvent(selfEventId);
 
-    scheduler.scheduleEvent(time::milliseconds(100), [&] { ++count; });
-    scheduler.scheduleEvent(time::milliseconds(100), [&] { ++count; });
-    scheduler.scheduleEvent(time::milliseconds(100), [&] { ++count; });
-    scheduler.scheduleEvent(time::milliseconds(100), [&] { ++count; });
-    scheduler.scheduleEvent(time::milliseconds(100), [&] { ++count; });
-    scheduler.scheduleEvent(time::milliseconds(100), [&] { ++count; });
+    scheduler.scheduleEvent(100_ms, [&] { ++count; });
+    scheduler.scheduleEvent(100_ms, [&] { ++count; });
+    scheduler.scheduleEvent(100_ms, [&] { ++count; });
+    scheduler.scheduleEvent(100_ms, [&] { ++count; });
+    scheduler.scheduleEvent(100_ms, [&] { ++count; });
+    scheduler.scheduleEvent(100_ms, [&] { ++count; });
   }
 
 public:
@@ -168,30 +168,30 @@
 
 BOOST_FIXTURE_TEST_CASE(Reschedule, SelfRescheduleFixture)
 {
-  selfEventId = scheduler.scheduleEvent(time::seconds(0),
+  selfEventId = scheduler.scheduleEvent(0_s,
                                         bind(&SelfRescheduleFixture::reschedule, this));
 
-  BOOST_REQUIRE_NO_THROW(advanceClocks(time::milliseconds(50), time::milliseconds(1000)));
+  BOOST_REQUIRE_NO_THROW(advanceClocks(50_ms, 1000_ms));
 
   BOOST_CHECK_EQUAL(count, 5);
 }
 
 BOOST_FIXTURE_TEST_CASE(Reschedule2, SelfRescheduleFixture)
 {
-  selfEventId = scheduler.scheduleEvent(time::seconds(0),
+  selfEventId = scheduler.scheduleEvent(0_s,
                                         bind(&SelfRescheduleFixture::reschedule2, this));
 
-  BOOST_REQUIRE_NO_THROW(advanceClocks(time::milliseconds(50), time::milliseconds(1000)));
+  BOOST_REQUIRE_NO_THROW(advanceClocks(50_ms, 1000_ms));
 
   BOOST_CHECK_EQUAL(count, 5);
 }
 
 BOOST_FIXTURE_TEST_CASE(Reschedule3, SelfRescheduleFixture)
 {
-  selfEventId = scheduler.scheduleEvent(time::seconds(0),
+  selfEventId = scheduler.scheduleEvent(0_s,
                                         bind(&SelfRescheduleFixture::reschedule3, this));
 
-  BOOST_REQUIRE_NO_THROW(advanceClocks(time::milliseconds(50), time::milliseconds(1000)));
+  BOOST_REQUIRE_NO_THROW(advanceClocks(50_ms, 1000_ms));
 
   BOOST_CHECK_EQUAL(count, 6);
 }
@@ -209,7 +209,7 @@
   {
     ++count;
 
-    scheduler.scheduleEvent(time::seconds(1), [&] { event(); });
+    scheduler.scheduleEvent(1_s, [&] { event(); });
   }
 
 public:
@@ -218,15 +218,15 @@
 
 BOOST_FIXTURE_TEST_CASE(CancelAll, CancelAllFixture)
 {
-  scheduler.scheduleEvent(time::milliseconds(500), [&] { scheduler.cancelAllEvents(); });
+  scheduler.scheduleEvent(500_ms, [&] { scheduler.cancelAllEvents(); });
 
-  scheduler.scheduleEvent(time::seconds(1), [&] { event(); });
+  scheduler.scheduleEvent(1_s, [&] { event(); });
 
-  scheduler.scheduleEvent(time::seconds(3), [] {
+  scheduler.scheduleEvent(3_s, [] {
       BOOST_ERROR("This event should have been cancelled" );
     });
 
-  advanceClocks(time::milliseconds(100), 100);
+  advanceClocks(100_ms, 100);
 
   BOOST_CHECK_EQUAL(count, 0);
 }
@@ -235,7 +235,7 @@
 {
   Scheduler sched(io);
   ScopedEventId eid(sched);
-  eid = sched.scheduleEvent(time::milliseconds(10), []{});
+  eid = sched.scheduleEvent(10_ms, []{});
   sched.cancelAllEvents();
   eid.cancel(); // should not crash
 
@@ -266,7 +266,7 @@
   BOOST_CHECK_EQUAL(eid == nullptr, true);
   BOOST_CHECK_EQUAL(eid != nullptr, false);
 
-  eid = scheduler.scheduleEvent(time::milliseconds(10), []{});
+  eid = scheduler.scheduleEvent(10_ms, []{});
   BOOST_CHECK_EQUAL(eid == eid2, false);
   BOOST_CHECK_EQUAL(eid != eid2, true);
   BOOST_CHECK_EQUAL(eid == nullptr, false);
@@ -276,7 +276,7 @@
   BOOST_CHECK_EQUAL(eid == eid2, true);
   BOOST_CHECK_EQUAL(eid != eid2, false);
 
-  eid2 = scheduler.scheduleEvent(time::milliseconds(10), []{});
+  eid2 = scheduler.scheduleEvent(10_ms, []{});
   BOOST_CHECK_EQUAL(eid == eid2, false);
   BOOST_CHECK_EQUAL(eid != eid2, true);
 }
@@ -287,7 +287,7 @@
   BOOST_CHECK_EQUAL(static_cast<bool>(eid), false);
   BOOST_CHECK_EQUAL(!eid, true);
 
-  eid = scheduler.scheduleEvent(time::milliseconds(10), []{});
+  eid = scheduler.scheduleEvent(10_ms, []{});
   BOOST_CHECK_EQUAL(static_cast<bool>(eid), true);
   BOOST_CHECK_EQUAL(!eid, false);
 
@@ -302,10 +302,10 @@
 BOOST_AUTO_TEST_CASE(DuringCallback)
 {
   EventId eid;
-  EventId eid2 = scheduler.scheduleEvent(time::milliseconds(20), []{});
+  EventId eid2 = scheduler.scheduleEvent(20_ms, []{});
 
   bool isCallbackInvoked = false;
-  eid = scheduler.scheduleEvent(time::milliseconds(10), [this, &eid, &eid2, &isCallbackInvoked] {
+  eid = scheduler.scheduleEvent(10_ms, [this, &eid, &eid2, &isCallbackInvoked] {
     isCallbackInvoked = true;
 
     // eid is "expired" during callback execution
@@ -320,20 +320,20 @@
     BOOST_CHECK_EQUAL(eid == eid2, true);
     BOOST_CHECK_EQUAL(eid != eid2, false);
   });
-  this->advanceClocks(time::milliseconds(6), 2);
+  this->advanceClocks(6_ms, 2);
   BOOST_CHECK(isCallbackInvoked);
 }
 
 BOOST_AUTO_TEST_CASE(Reset)
 {
   bool isCallbackInvoked = false;
-  EventId eid = scheduler.scheduleEvent(time::milliseconds(10),
+  EventId eid = scheduler.scheduleEvent(10_ms,
                                         [&isCallbackInvoked]{ isCallbackInvoked = true; });
   eid.reset();
   BOOST_CHECK_EQUAL(!eid, true);
   BOOST_CHECK_EQUAL(eid == nullptr, true);
 
-  this->advanceClocks(time::milliseconds(6), 2);
+  this->advanceClocks(6_ms, 2);
   BOOST_CHECK(isCallbackInvoked);
 }
 
@@ -344,7 +344,7 @@
   EventId eid;
   BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(eid), nullString);
 
-  eid = scheduler.scheduleEvent(time::milliseconds(10), []{});
+  eid = scheduler.scheduleEvent(10_ms, []{});
   BOOST_TEST_MESSAGE("eid=" << eid);
   BOOST_CHECK_NE(boost::lexical_cast<std::string>(eid), nullString);
 }
@@ -360,9 +360,9 @@
   int hit = 0;
   {
     ScopedEventId se(scheduler);
-    se = scheduler.scheduleEvent(time::milliseconds(10), [&] { ++hit; });
+    se = scheduler.scheduleEvent(10_ms, [&] { ++hit; });
   } // se goes out of scope
-  this->advanceClocks(time::milliseconds(1), 15);
+  this->advanceClocks(1_ms, 15);
   BOOST_CHECK_EQUAL(hit, 0);
 }
 
@@ -370,9 +370,9 @@
 {
   int hit1 = 0, hit2 = 0;
   ScopedEventId se1(scheduler);
-  se1 = scheduler.scheduleEvent(time::milliseconds(10), [&] { ++hit1; });
-  se1 = scheduler.scheduleEvent(time::milliseconds(10), [&] { ++hit2; });
-  this->advanceClocks(time::milliseconds(1), 15);
+  se1 = scheduler.scheduleEvent(10_ms, [&] { ++hit1; });
+  se1 = scheduler.scheduleEvent(10_ms, [&] { ++hit2; });
+  this->advanceClocks(1_ms, 15);
   BOOST_CHECK_EQUAL(hit1, 0);
   BOOST_CHECK_EQUAL(hit2, 1);
 }
@@ -382,10 +382,10 @@
   int hit = 0;
   {
     ScopedEventId se(scheduler);
-    se = scheduler.scheduleEvent(time::milliseconds(10), [&] { ++hit; });
+    se = scheduler.scheduleEvent(10_ms, [&] { ++hit; });
     se.release();
   } // se goes out of scope
-  this->advanceClocks(time::milliseconds(1), 15);
+  this->advanceClocks(1_ms, 15);
   BOOST_CHECK_EQUAL(hit, 1);
 }
 
@@ -395,10 +395,10 @@
   unique_ptr<scheduler::ScopedEventId> se2;
   {
     ScopedEventId se(scheduler);
-    se = scheduler.scheduleEvent(time::milliseconds(10), [&] { ++hit; });
+    se = scheduler.scheduleEvent(10_ms, [&] { ++hit; });
     se2.reset(new ScopedEventId(std::move(se)));
   } // se goes out of scope
-  this->advanceClocks(time::milliseconds(1), 15);
+  this->advanceClocks(1_ms, 15);
   BOOST_CHECK_EQUAL(hit, 1);
 }
 
diff --git a/tests/unit-tests/util/segment-fetcher.t.cpp b/tests/unit-tests/util/segment-fetcher.t.cpp
index 0b512e8..edcb9ca 100644
--- a/tests/unit-tests/util/segment-fetcher.t.cpp
+++ b/tests/unit-tests/util/segment-fetcher.t.cpp
@@ -82,7 +82,7 @@
     const Interest& lastInterest = face.sentInterests.back();
     lp::Nack nack = makeNack(lastInterest, nackReason);
     face.receive(nack);
-    advanceClocks(time::milliseconds(10));
+    advanceClocks(10_ms);
   }
 
 public:
@@ -98,12 +98,12 @@
 BOOST_FIXTURE_TEST_CASE(Timeout, Fixture)
 {
   DummyValidator acceptValidator;
-  SegmentFetcher::fetch(face, Interest("/hello/world", time::milliseconds(100)),
+  SegmentFetcher::fetch(face, Interest("/hello/world", 100_ms),
                         acceptValidator,
                         bind(&Fixture::onComplete, this, _1),
                         bind(&Fixture::onError, this, _1));
 
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
   BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
 
   const Interest& interest = face.sentInterests[0];
@@ -111,12 +111,12 @@
   BOOST_CHECK_EQUAL(interest.getMustBeFresh(), true);
   BOOST_CHECK_EQUAL(interest.getChildSelector(), 1);
 
-  advanceClocks(time::milliseconds(98));
+  advanceClocks(98_ms);
   BOOST_CHECK_EQUAL(nErrors, 0);
   BOOST_CHECK_EQUAL(nData, 0);
   BOOST_CHECK_EQUAL(face.sentData.size(), 0);
 
-  advanceClocks(time::milliseconds(1), 2);
+  advanceClocks(1_ms, 2);
   BOOST_CHECK_EQUAL(nErrors, 1);
   BOOST_CHECK_EQUAL(lastError, static_cast<uint32_t>(SegmentFetcher::INTEREST_TIMEOUT));
   BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
@@ -127,15 +127,15 @@
 BOOST_FIXTURE_TEST_CASE(Basic, Fixture)
 {
   DummyValidator acceptValidator;
-  SegmentFetcher::fetch(face, Interest("/hello/world", time::seconds(1000)),
+  SegmentFetcher::fetch(face, Interest("/hello/world", 1000_s),
                         acceptValidator,
                         bind(&Fixture::onComplete, this, _1),
                         bind(&Fixture::onError, this, _1));
 
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
 
   face.receive(*makeDataSegment("/hello/world/version0", 0, true));
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
 
   BOOST_CHECK_EQUAL(nErrors, 0);
   BOOST_CHECK_EQUAL(nData, 1);
@@ -159,19 +159,19 @@
 BOOST_FIXTURE_TEST_CASE(NoSegmentInData, Fixture)
 {
   DummyValidator acceptValidator;
-  SegmentFetcher::fetch(face, Interest("/hello/world", time::seconds(1000)),
+  SegmentFetcher::fetch(face, Interest("/hello/world", 1000_s),
                         acceptValidator,
                         bind(&Fixture::onComplete, this, _1),
                         bind(&Fixture::onError, this, _1));
 
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
 
   const uint8_t buffer[] = "Hello, world!";
   auto data = makeData("/hello/world/version0/no-segment");
   data->setContent(buffer, sizeof(buffer));
 
   face.receive(*data);
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
 
   BOOST_CHECK_EQUAL(nErrors, 1);
   BOOST_CHECK_EQUAL(lastError, static_cast<uint32_t>(SegmentFetcher::DATA_HAS_NO_SEGMENT));
@@ -181,14 +181,14 @@
 BOOST_FIXTURE_TEST_CASE(SegmentValidationFailure, Fixture)
 {
   DummyValidator rejectValidator(false);
-  SegmentFetcher::fetch(face, Interest("/hello/world", time::seconds(1000)),
+  SegmentFetcher::fetch(face, Interest("/hello/world", 1000_s),
                         rejectValidator,
                         bind(&Fixture::onComplete, this, _1),
                         bind(&Fixture::onError, this, _1));
 
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
   face.receive(*makeDataSegment("/hello/world/version0", 0, true));
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
 
   BOOST_CHECK_EQUAL(nErrors, 1);
   BOOST_CHECK_EQUAL(lastError, static_cast<uint32_t>(SegmentFetcher::SEGMENT_VALIDATION_FAIL));
@@ -198,21 +198,21 @@
 BOOST_FIXTURE_TEST_CASE(Triple, Fixture)
 {
   DummyValidator acceptValidator;
-  SegmentFetcher::fetch(face, Interest("/hello/world", time::seconds(1000)),
+  SegmentFetcher::fetch(face, Interest("/hello/world", 1000_s),
                         acceptValidator,
                         bind(&Fixture::onComplete, this, _1),
                         bind(&Fixture::onError, this, _1));
 
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
   face.receive(*makeDataSegment("/hello/world/version0", 0, false));
 
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
   face.receive(*makeDataSegment("/hello/world/version0", 1, false));
 
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
   face.receive(*makeDataSegment("/hello/world/version0", 2, true));
 
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
 
   BOOST_CHECK_EQUAL(nErrors, 0);
   BOOST_CHECK_EQUAL(nData, 1);
@@ -247,24 +247,24 @@
 BOOST_FIXTURE_TEST_CASE(TripleWithInitialSegmentFetching, Fixture)
 {
   DummyValidator acceptValidator;
-  SegmentFetcher::fetch(face, Interest("/hello/world", time::seconds(1000)),
+  SegmentFetcher::fetch(face, Interest("/hello/world", 1000_s),
                         acceptValidator,
                         bind(&Fixture::onComplete, this, _1),
                         bind(&Fixture::onError, this, _1));
 
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
   face.receive(*makeDataSegment("/hello/world/version0", 1, false));
 
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
   face.receive(*makeDataSegment("/hello/world/version0", 0, false));
 
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
   face.receive(*makeDataSegment("/hello/world/version0", 1, false));
 
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
   face.receive(*makeDataSegment("/hello/world/version0", 2, true));
 
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
 
   BOOST_CHECK_EQUAL(nErrors, 0);
   BOOST_CHECK_EQUAL(nData, 1);
@@ -306,21 +306,21 @@
 BOOST_FIXTURE_TEST_CASE(MultipleSegmentFetching, Fixture)
 {
   DummyValidator acceptValidator;
-  SegmentFetcher::fetch(face, Interest("/hello/world", time::seconds(1000)),
+  SegmentFetcher::fetch(face, Interest("/hello/world", 1000_s),
                         acceptValidator,
                         bind(&Fixture::onComplete, this, _1),
                         bind(&Fixture::onError, this, _1));
 
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
 
   for (uint64_t i = 0; i < 400; i++) {
-    advanceClocks(time::milliseconds(10));
+    advanceClocks(10_ms);
     face.receive(*makeDataSegment("/hello/world/version0", i, false));
   }
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
   face.receive(*makeDataSegment("/hello/world/version0", 400, true));
 
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
 
   BOOST_CHECK_EQUAL(nErrors, 0);
   BOOST_CHECK_EQUAL(nData, 1);
@@ -328,11 +328,11 @@
 
 BOOST_FIXTURE_TEST_CASE(DuplicateNack, Fixture)
 {
-  SegmentFetcher::fetch(face, Interest("/hello/world", time::seconds(1000)),
+  SegmentFetcher::fetch(face, Interest("/hello/world", 1000_s),
                         make_shared<DummyValidator>(true),
                         bind(&Fixture::onComplete, this, _1),
                         bind(&Fixture::onError, this, _1));
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
 
   // receive nack for the original interest
   nackLastInterest(lp::NackReason::DUPLICATE);
@@ -348,11 +348,11 @@
 
 BOOST_FIXTURE_TEST_CASE(CongestionNack, Fixture)
 {
-  SegmentFetcher::fetch(face, Interest("/hello/world", time::seconds(1000)),
+  SegmentFetcher::fetch(face, Interest("/hello/world", 1000_s),
                         make_shared<DummyValidator>(true),
                         bind(&Fixture::onComplete, this, _1),
                         bind(&Fixture::onError, this, _1));
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
 
   // receive nack for the original interest
   nackLastInterest(lp::NackReason::CONGESTION);
@@ -377,19 +377,19 @@
                         bind(&Fixture::onComplete, this, _1),
                         bind(&Fixture::onError, this, _1));
 
-  advanceClocks(time::milliseconds(1000));
+  advanceClocks(1000_ms);
 
   for (uint64_t segmentNo = 0; segmentNo <= 3; segmentNo++) {
     if (segmentNo == 1) {
       while (nNacks--) {
         nackLastInterest(lp::NackReason::CONGESTION);
-        advanceClocks(time::milliseconds(10));
+        advanceClocks(10_ms);
       }
     }
 
     auto data = makeDataSegment(interestName, segmentNo, segmentNo == 3);
     face.receive(*data);
-    advanceClocks(time::milliseconds(10));
+    advanceClocks(10_ms);
   }
 
   // Total number of sent interests should be 6: one interest for segment zero and segment one each,
@@ -411,7 +411,7 @@
                         make_shared<DummyValidator>(true),
                         bind(&Fixture::onComplete, this, _1),
                         bind(&Fixture::onError, this, _1));
-  advanceClocks(time::milliseconds(10));
+  advanceClocks(10_ms);
   nackLastInterest(lp::NackReason::DUPLICATE);
   face.receive(*makeDataSegment("/hello/world", 0, true));
 
@@ -430,7 +430,7 @@
       return flipResult;
     });
   shared_ptr<SegmentFetcher> fetcher =
-    SegmentFetcher::fetch(face, Interest("/hello/world", time::seconds(1000)),
+    SegmentFetcher::fetch(face, Interest("/hello/world", 1000_s),
                           validator,
                           bind(&Fixture::onComplete, this, _1),
                           bind(&Fixture::onError, this, _1));
@@ -448,15 +448,15 @@
       ++nValidatedSegments;
     });
 
-  advanceClocks(time::milliseconds(10), 10);
+  advanceClocks(10_ms, 10);
 
   face.receive(*data1);
 
-  advanceClocks(time::milliseconds(10), 10);
+  advanceClocks(10_ms, 10);
 
   face.receive(*data2);
 
-  advanceClocks(time::milliseconds(10), 10);
+  advanceClocks(10_ms, 10);
 
   BOOST_CHECK_EQUAL(nRecvSegments, 2);
   BOOST_CHECK_EQUAL(nValidatedSegments, 1);
diff --git a/tests/unit-tests/util/time-unit-test-clock.t.cpp b/tests/unit-tests/util/time-unit-test-clock.t.cpp
index 20330fd..dd8346a 100644
--- a/tests/unit-tests/util/time-unit-test-clock.t.cpp
+++ b/tests/unit-tests/util/time-unit-test-clock.t.cpp
@@ -43,11 +43,11 @@
   BOOST_CHECK_EQUAL(time::system_clock::now().time_since_epoch(),
                     time::UnitTestClockTraits<time::system_clock>::getDefaultStartTime());
 
-  steadyClock->advance(time::days(1));
+  steadyClock->advance(1_day);
   BOOST_CHECK_EQUAL(time::system_clock::now().time_since_epoch(),
                     time::UnitTestClockTraits<time::system_clock>::getDefaultStartTime());
 
-  systemClock->advance(time::days(1));
+  systemClock->advance(1_day);
   BOOST_CHECK_GT(time::system_clock::now().time_since_epoch(),
                  time::UnitTestClockTraits<time::system_clock>::getDefaultStartTime());
 
@@ -77,16 +77,16 @@
   BOOST_CHECK_EQUAL(time::fromIsoString("20140129T034247.032000"), referenceTime);
   BOOST_CHECK_EQUAL(time::fromIsoString("20140129T034247.032000Z"), referenceTime);
   BOOST_CHECK_EQUAL(time::fromString("2014-01-29 03:42:47"),
-                    time::fromUnixTimestamp(time::seconds(1390966967)));
+                    time::fromUnixTimestamp(1390966967_s));
 
   // Unfortunately, not all systems has lv_LV locale installed :(
   // BOOST_CHECK_EQUAL(time::fromString("2014. gada 29. Janvāris", "%Y. gada %d. %B",
   //                                    std::locale("lv_LV.UTF-8")),
-  //                   time::fromUnixTimestamp(time::seconds(1390953600)));
+  //                   time::fromUnixTimestamp(1390953600_s));
 
   BOOST_CHECK_EQUAL(time::fromString("2014 -- 29 -- January", "%Y -- %d -- %B",
                                      std::locale("C")),
-                    time::fromUnixTimestamp(time::seconds(1390953600)));
+                    time::fromUnixTimestamp(1390953600_s));
 }
 
 BOOST_AUTO_TEST_CASE(SteadyClock)
@@ -98,18 +98,18 @@
   BOOST_CHECK_EQUAL(time::steady_clock::now().time_since_epoch(),
                     time::steady_clock::duration::zero());
 
-  systemClock->advance(time::days(36500));
+  systemClock->advance(36500_days);
   BOOST_CHECK_EQUAL(time::steady_clock::now().time_since_epoch(),
                     time::steady_clock::duration::zero());
 
-  steadyClock->advance(time::nanoseconds(100));
-  BOOST_CHECK_EQUAL(time::steady_clock::now().time_since_epoch(), time::nanoseconds(100));
+  steadyClock->advance(100_ns);
+  BOOST_CHECK_EQUAL(time::steady_clock::now().time_since_epoch(), 100_ns);
 
-  steadyClock->advance(time::microseconds(100));
-  BOOST_CHECK_EQUAL(time::steady_clock::now().time_since_epoch(), time::nanoseconds(100100));
+  steadyClock->advance(100_us);
+  BOOST_CHECK_EQUAL(time::steady_clock::now().time_since_epoch(), 100100_ns);
 
-  steadyClock->setNow(time::milliseconds(1));
-  BOOST_CHECK_EQUAL(time::steady_clock::now().time_since_epoch(), time::nanoseconds(1000000));
+  steadyClock->setNow(1_ms);
+  BOOST_CHECK_EQUAL(time::steady_clock::now().time_since_epoch(), 1000000_ns);
 
   BOOST_CHECK_EQUAL(boost::lexical_cast<std::string>(time::steady_clock::now()),
                     "1000000 nanoseconds since unit test beginning");
@@ -120,12 +120,12 @@
   ndn::Scheduler scheduler(io);
 
   bool hasFired = false;
-  scheduler.scheduleEvent(time::seconds(100), [&] { hasFired = true; });
+  scheduler.scheduleEvent(100_s, [&] { hasFired = true; });
 
   io.poll();
   BOOST_CHECK_EQUAL(hasFired, false);
 
-  steadyClock->advance(time::seconds(100));
+  steadyClock->advance(100_s);
 
   io.poll();
   BOOST_CHECK_EQUAL(hasFired, true);
diff --git a/tests/unit-tests/util/time.t.cpp b/tests/unit-tests/util/time.t.cpp
index 3d7160d..58fdfae 100644
--- a/tests/unit-tests/util/time.t.cpp
+++ b/tests/unit-tests/util/time.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2013-2017 Regents of the University of California.
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -23,6 +23,8 @@
 
 #include "boost-test.hpp"
 
+#include <thread>
+
 namespace ndn {
 namespace time {
 namespace tests {
@@ -42,12 +44,10 @@
   BOOST_CHECK_EQUAL(toString(referenceTime), "2014-01-29 03:42:47");
 
   // Unfortunately, not all systems has lv_LV locale installed :(
-  // BOOST_CHECK_EQUAL(toString(referenceTime, "%Y. gada %d. %B",
-  //                                  std::locale("lv_LV.UTF-8")),
+  // BOOST_CHECK_EQUAL(toString(referenceTime, "%Y. gada %d. %B", std::locale("lv_LV.UTF-8")),
   //                   "2014. gada 29. Janvāris");
 
-  BOOST_CHECK_EQUAL(toString(referenceTime, "%Y -- %d -- %B",
-                                   std::locale("C")),
+  BOOST_CHECK_EQUAL(toString(referenceTime, "%Y -- %d -- %B", std::locale("C")),
                     "2014 -- 29 -- January");
 
   BOOST_CHECK_EQUAL(fromIsoString("20140129T034247.032000"), referenceTime);
@@ -56,21 +56,18 @@
                     fromUnixTimestamp(seconds(1390966967)));
 
   // Unfortunately, not all systems has lv_LV locale installed :(
-  // BOOST_CHECK_EQUAL(fromString("2014. gada 29. Janvāris", "%Y. gada %d. %B",
-  //                                    std::locale("lv_LV.UTF-8")),
+  // BOOST_CHECK_EQUAL(fromString("2014. gada 29. Janvāris", "%Y. gada %d. %B", std::locale("lv_LV.UTF-8")),
   //                   fromUnixTimestamp(seconds(1390953600)));
 
-  BOOST_CHECK_EQUAL(fromString("2014 -- 29 -- January", "%Y -- %d -- %B",
-                                     std::locale("C")),
+  BOOST_CHECK_EQUAL(fromString("2014 -- 29 -- January", "%Y -- %d -- %B", std::locale("C")),
                     fromUnixTimestamp(seconds(1390953600)));
 }
 
 BOOST_AUTO_TEST_CASE(SteadyClock)
 {
   steady_clock::TimePoint oldValue = steady_clock::now();
-  usleep(100);
+  std::this_thread::sleep_for(std::chrono::milliseconds(1));
   steady_clock::TimePoint newValue = steady_clock::now();
-
   BOOST_CHECK_GT(newValue, oldValue);
 }
 
@@ -83,13 +80,41 @@
 
 BOOST_AUTO_TEST_CASE(LargeDates)
 {
-  system_clock::TimePoint value = fromUnixTimestamp(milliseconds(1390966967032LL));
+  auto value = fromUnixTimestamp(milliseconds(1390966967032LL));
   BOOST_CHECK_EQUAL(toIsoString(value), "20140129T034247.032000");
 
   value += days(365 * 100 + 25 - 1); // 36524 days
   BOOST_CHECK_EQUAL(toIsoString(value), "21140129T034247.032000");
 }
 
+BOOST_AUTO_TEST_CASE(Literals)
+{
+  BOOST_CHECK_EQUAL(42_s, seconds(42));
+
+  BOOST_CHECK_EQUAL(1_day, 24_h);
+  BOOST_CHECK_EQUAL(2_days, 48_h);
+  BOOST_CHECK_EQUAL(0.5_day, 12_h);
+  BOOST_CHECK_EQUAL(.5_days, 12_h);
+
+  BOOST_CHECK_EQUAL(1_h, 60_min);
+  BOOST_CHECK_EQUAL(0.5_h, 30_min);
+
+  BOOST_CHECK_EQUAL(1_min, 60_s);
+  BOOST_CHECK_EQUAL(0.5_min, 30_s);
+
+  BOOST_CHECK_EQUAL(1_s, 1000_ms);
+  BOOST_CHECK_EQUAL(0.5_s, 500_ms);
+
+  BOOST_CHECK_EQUAL(1_ms, 1000_us);
+  BOOST_CHECK_EQUAL(0.5_ms, 500_us);
+
+  BOOST_CHECK_EQUAL(1_us, 1000_ns);
+  BOOST_CHECK_EQUAL(0.5_us, 500_ns);
+
+  BOOST_CHECK_EQUAL(1_ns, nanoseconds(1));
+  BOOST_CHECK_EQUAL(5.5_ns, 0.0055_us);
+}
+
 BOOST_AUTO_TEST_SUITE_END() // TestTime
 BOOST_AUTO_TEST_SUITE_END() // Util
 
