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
 
