diff --git a/daemon/fw/asf-measurements.hpp b/daemon/fw/asf-measurements.hpp
index b5b1f8e..a3775b0 100644
--- a/daemon/fw/asf-measurements.hpp
+++ b/daemon/fw/asf-measurements.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018,  Regents of the University of California,
+ * Copyright (c) 2014-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -316,7 +316,7 @@
   extendLifetime(measurements::Entry& me);
 
 public:
-  static constexpr time::microseconds MEASUREMENTS_LIFETIME = 300_s;
+  static constexpr time::microseconds MEASUREMENTS_LIFETIME = 5_min;
 
 private:
   MeasurementsAccessor& m_measurements;
diff --git a/daemon/fw/self-learning-strategy.cpp b/daemon/fw/self-learning-strategy.cpp
index f0eab59..d199b86 100644
--- a/daemon/fw/self-learning-strategy.cpp
+++ b/daemon/fw/self-learning-strategy.cpp
@@ -42,7 +42,7 @@
 NFD_LOG_INIT(SelfLearningStrategy);
 NFD_REGISTER_STRATEGY(SelfLearningStrategy);
 
-const time::milliseconds SelfLearningStrategy::ROUTE_RENEW_LIFETIME(600_s);
+const time::milliseconds SelfLearningStrategy::ROUTE_RENEW_LIFETIME(10_min);
 
 SelfLearningStrategy::SelfLearningStrategy(Forwarder& forwarder, const Name& name)
   : Strategy(forwarder)
diff --git a/daemon/rib/readvertise/readvertise.cpp b/daemon/rib/readvertise/readvertise.cpp
index d5bedf8..7b59e22 100644
--- a/daemon/rib/readvertise/readvertise.cpp
+++ b/daemon/rib/readvertise/readvertise.cpp
@@ -35,7 +35,7 @@
 NFD_LOG_INIT(Readvertise);
 
 const time::milliseconds Readvertise::RETRY_DELAY_MIN = 50_s;
-const time::milliseconds Readvertise::RETRY_DELAY_MAX = 3600_s;
+const time::milliseconds Readvertise::RETRY_DELAY_MAX = 1_h;
 
 static time::milliseconds
 randomizeTimer(time::milliseconds baseTimer)
diff --git a/tests/core/config-file.t.cpp b/tests/core/config-file.t.cpp
index c2ceb85..05b2722 100644
--- a/tests/core/config-file.t.cpp
+++ b/tests/core/config-file.t.cpp
@@ -325,7 +325,7 @@
   BOOST_CHECK(subB.allCallbacksFired());
 }
 
-BOOST_AUTO_TEST_SUITE_END()
+BOOST_AUTO_TEST_SUITE_END() // TestConfigFile
 
 } // namespace tests
 } // namespace nfd
diff --git a/tests/core/ndebug.t.cpp b/tests/core/ndebug.t.cpp
index 3af09aa..8465b06 100644
--- a/tests/core/ndebug.t.cpp
+++ b/tests/core/ndebug.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -53,7 +53,7 @@
 #endif
 }
 
-BOOST_AUTO_TEST_SUITE_END()
+BOOST_AUTO_TEST_SUITE_END() // TestNdebug
 
 } // namespace tests
 } // namespace nfd
diff --git a/tests/core/rtt-estimator.t.cpp b/tests/core/rtt-estimator.t.cpp
index 526b03d..6673ecd 100644
--- a/tests/core/rtt-estimator.t.cpp
+++ b/tests/core/rtt-estimator.t.cpp
@@ -46,7 +46,7 @@
   RttEstimator rtt;
 
   for (int i = 0; i < 100; ++i) {
-    rtt.addMeasurement(time::seconds(5));
+    rtt.addMeasurement(5_s);
   }
   double rto1 = computeRtoAsFloatSeconds(rtt);
   BOOST_CHECK_CLOSE(rto1, 5.0, 0.1);
@@ -59,7 +59,7 @@
   double rto3 = computeRtoAsFloatSeconds(rtt);
   BOOST_CHECK_CLOSE(rto3, 20.0, 0.1);
 
-  rtt.addMeasurement(time::seconds(5)); // reset multiplier
+  rtt.addMeasurement(5_s); // reset multiplier
   double rto4 = computeRtoAsFloatSeconds(rtt);
   BOOST_CHECK_CLOSE(rto4, 5.0, 0.1);
 
@@ -68,7 +68,7 @@
   BOOST_CHECK_CLOSE(rto5, 10.0, 0.1);
 
   for (int i = 0; i < 5; ++i) {
-    rtt.addMeasurement(time::seconds(6));
+    rtt.addMeasurement(6_s);
   } // increased variance
   double rto6 = computeRtoAsFloatSeconds(rtt);
   BOOST_CHECK_GT(rto6, rto1);
diff --git a/tests/core/version.t.cpp b/tests/core/version.t.cpp
index 1de0e60..27e3799 100644
--- a/tests/core/version.t.cpp
+++ b/tests/core/version.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-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -56,7 +56,7 @@
   BOOST_CHECK_EQUAL(NFD_VERSION_STRING, buf);
 }
 
-BOOST_AUTO_TEST_SUITE_END()
+BOOST_AUTO_TEST_SUITE_END() // TestVersion
 
 } // namespace tests
 } // namespace nfd
diff --git a/tests/daemon/face/datagram-transport.t.cpp b/tests/daemon/face/datagram-transport.t.cpp
index d5ce2a8..fd1a8e0 100644
--- a/tests/daemon/face/datagram-transport.t.cpp
+++ b/tests/daemon/face/datagram-transport.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018,  Regents of the University of California,
+ * Copyright (c) 2014-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -149,7 +149,7 @@
     this->limitedIo.afterOp();
   });
 
-  BOOST_REQUIRE_EQUAL(this->limitedIo.run(1, time::seconds(1)), LimitedIo::EXCEED_OPS);
+  BOOST_REQUIRE_EQUAL(this->limitedIo.run(1, 1_s), LimitedIo::EXCEED_OPS);
 }
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(SendQueueLength, T, DatagramTransportFixtures, T)
diff --git a/tests/daemon/face/ethernet-channel.t.cpp b/tests/daemon/face/ethernet-channel.t.cpp
index d7a1cec..c1311da 100644
--- a/tests/daemon/face/ethernet-channel.t.cpp
+++ b/tests/daemon/face/ethernet-channel.t.cpp
@@ -39,7 +39,7 @@
   makeChannel()
   {
     BOOST_ASSERT(netifs.size() > 0);
-    return make_unique<EthernetChannel>(netifs.front(), time::seconds(2));
+    return make_unique<EthernetChannel>(netifs.front(), 2_s);
   }
 };
 
diff --git a/tests/daemon/face/ethernet-factory.t.cpp b/tests/daemon/face/ethernet-factory.t.cpp
index b69141d..e204cee 100644
--- a/tests/daemon/face/ethernet-factory.t.cpp
+++ b/tests/daemon/face/ethernet-factory.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018,  Regents of the University of California,
+ * Copyright (c) 2014-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -436,7 +436,7 @@
   BOOST_CHECK_EQUAL(factory.getChannels().empty(), true);
   SKIP_IF_ETHERNET_NETIF_COUNT_LT(1);
 
-  factory.createChannel(netifs.front(), time::minutes(1));
+  factory.createChannel(netifs.front(), 1_min);
   checkChannelListEqual(factory, {FaceUri::fromDev(netifs.front()->getName()).toString()});
 }
 
@@ -444,14 +444,14 @@
 {
   SKIP_IF_ETHERNET_NETIF_COUNT_LT(1);
 
-  auto channel1 = factory.createChannel(netifs.front(), time::minutes(1));
-  auto channel1a = factory.createChannel(netifs.front(), time::minutes(5));
+  auto channel1 = factory.createChannel(netifs.front(), 1_min);
+  auto channel1a = factory.createChannel(netifs.front(), 5_min);
   BOOST_CHECK_EQUAL(channel1, channel1a);
   BOOST_CHECK_EQUAL(channel1->getUri().toString(), "dev://" + netifs.front()->getName());
 
   SKIP_IF_ETHERNET_NETIF_COUNT_LT(2);
 
-  auto channel2 = factory.createChannel(netifs.back(), time::minutes(1));
+  auto channel2 = factory.createChannel(netifs.back(), 1_min);
   BOOST_CHECK_NE(channel1, channel2);
 }
 
@@ -464,7 +464,7 @@
              {CreateFaceExpectedResult::FAILURE, 504, "No channels available to connect"});
 
   SKIP_IF_ETHERNET_NETIF_COUNT_LT(1);
-  auto localUri = factory.createChannel(netifs.front(), time::minutes(1))->getUri();
+  auto localUri = factory.createChannel(netifs.front(), 1_min)->getUri();
 
   createFace(factory,
              FaceUri("ether://[00:00:5e:00:53:5e]"),
diff --git a/tests/daemon/face/ethernet-fixture.hpp b/tests/daemon/face/ethernet-fixture.hpp
index 5a8160e..1898d50 100644
--- a/tests/daemon/face/ethernet-fixture.hpp
+++ b/tests/daemon/face/ethernet-fixture.hpp
@@ -71,7 +71,7 @@
     BOOST_ASSERT(netif != nullptr);
     localEp = netif->getName();
     remoteEp = remoteAddr;
-    transport = make_unique<UnicastEthernetTransport>(*netif, remoteEp, persistency, time::seconds(2));
+    transport = make_unique<UnicastEthernetTransport>(*netif, remoteEp, persistency, 2_s);
   }
 
   /** \brief create a MulticastEthernetTransport
diff --git a/tests/daemon/face/generic-link-service.t.cpp b/tests/daemon/face/generic-link-service.t.cpp
index d10dba5..cf51e54 100644
--- a/tests/daemon/face/generic-link-service.t.cpp
+++ b/tests/daemon/face/generic-link-service.t.cpp
@@ -485,7 +485,7 @@
 {
   GenericLinkService::Options options;
   options.allowCongestionMarking = true;
-  options.baseCongestionMarkingInterval = time::milliseconds(100);
+  options.baseCongestionMarkingInterval = 100_ms;
   initialize(options, MTU_UNLIMITED, 65536);
   BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
   BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
@@ -522,7 +522,7 @@
 {
   GenericLinkService::Options options;
   options.allowCongestionMarking = true;
-  options.baseCongestionMarkingInterval = time::milliseconds(100);
+  options.baseCongestionMarkingInterval = 100_ms;
   initialize(options, MTU_UNLIMITED, 65536);
   BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
   BOOST_CHECK_EQUAL(service->m_lastMarkTime, time::steady_clock::TimePoint::min());
@@ -541,7 +541,7 @@
   BOOST_REQUIRE_NO_THROW(pkt1.wireDecode(transport->sentPackets.back().packet));
   BOOST_REQUIRE_EQUAL(pkt1.count<lp::CongestionMarkField>(), 1);
   BOOST_CHECK_EQUAL(pkt1.get<lp::CongestionMarkField>(), 1);
-  time::steady_clock::TimePoint nextMarkTime = time::steady_clock::now() + time::milliseconds(100);
+  time::steady_clock::TimePoint nextMarkTime = time::steady_clock::now() + 100_ms;
   BOOST_CHECK_EQUAL(service->m_nextMarkTime, nextMarkTime);
   time::steady_clock::TimePoint lastMarkTime = time::steady_clock::now();
   BOOST_CHECK_EQUAL(service->m_lastMarkTime, lastMarkTime);
@@ -549,7 +549,7 @@
   BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 1);
 
   // advance clock to half of marking interval cycle
-  advanceClocks(time::milliseconds(50));
+  advanceClocks(50_ms);
 
   // second congested packet, but within marking interval, will not be marked
   transport->setSendQueueLength(33000);
@@ -564,7 +564,7 @@
   BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 1);
 
   // advance clocks past end of initial interval cycle
-  this->advanceClocks(time::milliseconds(51));
+  this->advanceClocks(51_ms);
 
   // first congested packet after waiting marking interval, will be marked
   transport->setSendQueueLength(40000);
@@ -585,7 +585,7 @@
   BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 2);
 
   // advance clock partway through current marking interval
-  this->advanceClocks(markingInterval - time::milliseconds(10));
+  this->advanceClocks(markingInterval - 10_ms);
 
   // still congested, but within marking interval cycle
   transport->setSendQueueLength(38000);
@@ -600,7 +600,7 @@
   BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 2);
 
   // advance clocks past end of current marking interval cycle
-  this->advanceClocks(time::milliseconds(11));
+  this->advanceClocks(11_ms);
 
   // still congested, after marking interval cycle
   transport->setSendQueueLength(39000);
@@ -620,7 +620,7 @@
   BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 3);
   BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 3);
 
-  this->advanceClocks(time::milliseconds(1));
+  this->advanceClocks(1_ms);
 
   // still congested, but within marking interval cycle
   transport->setSendQueueLength(38000);
@@ -666,7 +666,7 @@
   BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
   BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 4);
 
-  this->advanceClocks(time::milliseconds(50));
+  this->advanceClocks(50_ms);
 
   // send queue congested again, but can't mark packet because within one full interval of last mark
   transport->setSendQueueLength(50000);
@@ -681,7 +681,7 @@
   BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 4);
 
   // advance clock past full 100ms interval since last mark
-  this->advanceClocks(time::milliseconds(51));
+  this->advanceClocks(51_ms);
 
   transport->setSendQueueLength(40000);
   face->sendInterest(*interest);
@@ -690,7 +690,7 @@
   BOOST_REQUIRE_NO_THROW(pkt10.wireDecode(transport->sentPackets.back().packet));
   BOOST_REQUIRE_EQUAL(pkt10.count<lp::CongestionMarkField>(), 1);
   BOOST_CHECK_EQUAL(pkt10.get<lp::CongestionMarkField>(), 1);
-  nextMarkTime = time::steady_clock::now() + time::milliseconds(100);
+  nextMarkTime = time::steady_clock::now() + 100_ms;
   BOOST_CHECK_EQUAL(service->m_nextMarkTime, nextMarkTime);
   lastMarkTime = time::steady_clock::now();
   BOOST_CHECK_EQUAL(service->m_lastMarkTime, lastMarkTime);
@@ -698,7 +698,7 @@
   BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 5);
 
   // advance clock partway through 100ms marking interval
-  this->advanceClocks(time::milliseconds(50));
+  this->advanceClocks(50_ms);
 
   // not marked since within 100ms window before can mark again
   transport->setSendQueueLength(50000);
@@ -713,7 +713,7 @@
   BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 5);
 
   // advance clocks past m_nextMarkTime
-  this->advanceClocks(time::milliseconds(51));
+  this->advanceClocks(51_ms);
 
   // markable packet, queue length still above threshold
   transport->setSendQueueLength(33000);
@@ -746,7 +746,7 @@
   BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 6);
 
   // advance clocks past one full interval since last mark
-  this->advanceClocks(time::milliseconds(101));
+  this->advanceClocks(101_ms);
 
   // start congestion again
   transport->setSendQueueLength(50000);
@@ -756,7 +756,7 @@
   BOOST_REQUIRE_NO_THROW(pkt14.wireDecode(transport->sentPackets.back().packet));
   BOOST_REQUIRE_EQUAL(pkt14.count<lp::CongestionMarkField>(), 1);
   BOOST_CHECK_EQUAL(pkt14.get<lp::CongestionMarkField>(), 1);
-  nextMarkTime = time::steady_clock::now() + time::milliseconds(100);
+  nextMarkTime = time::steady_clock::now() + 100_ms;
   BOOST_CHECK_EQUAL(service->m_nextMarkTime, nextMarkTime);
   lastMarkTime = time::steady_clock::now();
   BOOST_CHECK_EQUAL(service->m_lastMarkTime, lastMarkTime);
@@ -780,7 +780,7 @@
 {
   GenericLinkService::Options options;
   options.allowCongestionMarking = true;
-  options.baseCongestionMarkingInterval = time::milliseconds(100);
+  options.baseCongestionMarkingInterval = 100_ms;
   initialize(options, MTU_UNLIMITED, QUEUE_UNSUPPORTED);
   BOOST_CHECK_EQUAL(service->m_nextMarkTime, time::steady_clock::TimePoint::max());
   BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 0);
@@ -821,7 +821,7 @@
   BOOST_REQUIRE_NO_THROW(pkt3.wireDecode(transport->sentPackets.back().packet));
   BOOST_REQUIRE_EQUAL(pkt3.count<lp::CongestionMarkField>(), 1);
   BOOST_CHECK_EQUAL(pkt3.get<lp::CongestionMarkField>(), 1);
-  time::steady_clock::TimePoint nextMarkTime = time::steady_clock::now() + time::milliseconds(100);
+  time::steady_clock::TimePoint nextMarkTime = time::steady_clock::now() + 100_ms;
   BOOST_CHECK_EQUAL(service->m_nextMarkTime, nextMarkTime);
   BOOST_CHECK_EQUAL(service->m_nMarkedSinceInMarkingState, 1);
   BOOST_CHECK_EQUAL(service->getCounters().nCongestionMarked, 1);
diff --git a/tests/daemon/face/internal-face.t.cpp b/tests/daemon/face/internal-face.t.cpp
index 4c1618b..9ea6903 100644
--- a/tests/daemon/face/internal-face.t.cpp
+++ b/tests/daemon/face/internal-face.t.cpp
@@ -83,19 +83,19 @@
 BOOST_AUTO_TEST_CASE(ReceiveInterestTimeout)
 {
   shared_ptr<Interest> interest = makeInterest("/TLETccRv");
-  interest->setInterestLifetime(time::milliseconds(100));
+  interest->setInterestLifetime(100_ms);
 
   bool hasTimeout = false;
   clientFace->expressInterest(*interest,
     bind([] { BOOST_ERROR("unexpected Data"); }),
     bind([] { BOOST_ERROR("unexpected Nack"); }),
     bind([&hasTimeout] { hasTimeout = true; }));
-  this->advanceClocks(time::milliseconds(1), 10);
+  this->advanceClocks(1_ms, 10);
 
   BOOST_REQUIRE_EQUAL(receivedInterests.size(), 1);
   BOOST_CHECK_EQUAL(receivedInterests.back().getName(), "/TLETccRv");
 
-  this->advanceClocks(time::milliseconds(1), 100);
+  this->advanceClocks(1_ms, 100);
 
   BOOST_CHECK(hasTimeout);
 }
@@ -112,14 +112,14 @@
     },
     bind([] { BOOST_ERROR("unexpected Nack"); }),
     bind([] { BOOST_ERROR("unexpected timeout"); }));
-  this->advanceClocks(time::milliseconds(1), 10);
+  this->advanceClocks(1_ms, 10);
 
   BOOST_REQUIRE_EQUAL(receivedInterests.size(), 1);
   BOOST_CHECK_EQUAL(receivedInterests.back().getName(), "/PQstEJGdL");
 
   shared_ptr<Data> data = makeData("/PQstEJGdL/aI7oCrDXNX");
   forwarderFace->sendData(*data);
-  this->advanceClocks(time::milliseconds(1), 10);
+  this->advanceClocks(1_ms, 10);
 
   BOOST_CHECK(hasReceivedData);
 }
@@ -136,14 +136,14 @@
       BOOST_CHECK_EQUAL(nack.getReason(), lp::NackReason::NO_ROUTE);
     },
     bind([] { BOOST_ERROR("unexpected timeout"); }));
-  this->advanceClocks(time::milliseconds(1), 10);
+  this->advanceClocks(1_ms, 10);
 
   BOOST_REQUIRE_EQUAL(receivedInterests.size(), 1);
   BOOST_CHECK_EQUAL(receivedInterests.back().getName(), "/1HrsRM1X");
 
   lp::Nack nack = makeNack("/1HrsRM1X", 152, lp::NackReason::NO_ROUTE);
   forwarderFace->sendNack(nack);
-  this->advanceClocks(time::milliseconds(1), 10);
+  this->advanceClocks(1_ms, 10);
 
   BOOST_CHECK(hasReceivedNack);
 }
@@ -162,7 +162,7 @@
 
   shared_ptr<Interest> interest = makeInterest("/Wpc8TnEeoF/f6SzV8hD");
   forwarderFace->sendInterest(*interest);
-  this->advanceClocks(time::milliseconds(1), 10);
+  this->advanceClocks(1_ms, 10);
 
   BOOST_CHECK(hasDeliveredInterest);
   BOOST_REQUIRE_EQUAL(receivedData.size(), 1);
@@ -183,7 +183,7 @@
 
   shared_ptr<Interest> interest = makeInterest("/4YgJKWcXN/5oaTe05o", 191);
   forwarderFace->sendInterest(*interest);
-  this->advanceClocks(time::milliseconds(1), 10);
+  this->advanceClocks(1_ms, 10);
 
   BOOST_CHECK(hasDeliveredInterest);
   BOOST_REQUIRE_EQUAL(receivedNacks.size(), 1);
@@ -193,19 +193,19 @@
 BOOST_AUTO_TEST_CASE(CloseForwarderFace)
 {
   forwarderFace->close();
-  this->advanceClocks(time::milliseconds(1), 10);
+  this->advanceClocks(1_ms, 10);
   BOOST_CHECK_EQUAL(forwarderFace->getState(), FaceState::CLOSED);
   forwarderFace.reset();
 
   shared_ptr<Interest> interest = makeInterest("/zpHsVesu0B");
-  interest->setInterestLifetime(time::milliseconds(100));
+  interest->setInterestLifetime(100_ms);
 
   bool hasTimeout = false;
   clientFace->expressInterest(*interest,
     bind([] { BOOST_ERROR("unexpected Data"); }),
     bind([] { BOOST_ERROR("unexpected Nack"); }),
     bind([&hasTimeout] { hasTimeout = true; }));
-  BOOST_CHECK_NO_THROW(this->advanceClocks(time::milliseconds(1), 200));
+  BOOST_CHECK_NO_THROW(this->advanceClocks(1_ms, 200));
 
   BOOST_CHECK_EQUAL(receivedInterests.size(), 0);
   BOOST_CHECK(hasTimeout);
@@ -218,7 +218,7 @@
 
   shared_ptr<Interest> interest = makeInterest("/aau42XQqb");
   forwarderFace->sendInterest(*interest);
-  BOOST_CHECK_NO_THROW(this->advanceClocks(time::milliseconds(1), 10));
+  BOOST_CHECK_NO_THROW(this->advanceClocks(1_ms, 10));
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestInternalFace
diff --git a/tests/daemon/face/lp-reassembler.t.cpp b/tests/daemon/face/lp-reassembler.t.cpp
index f24eb98..8e8bbce 100644
--- a/tests/daemon/face/lp-reassembler.t.cpp
+++ b/tests/daemon/face/lp-reassembler.t.cpp
@@ -312,7 +312,7 @@
   BOOST_CHECK_EQUAL(reassembler.size(), 1);
   BOOST_CHECK(timeoutHistory.empty());
 
-  advanceClocks(time::milliseconds(1), 600);
+  advanceClocks(1_ms, 600);
   BOOST_CHECK_EQUAL(reassembler.size(), 0);
   BOOST_REQUIRE_EQUAL(timeoutHistory.size(), 1);
   BOOST_CHECK_EQUAL(std::get<0>(timeoutHistory.back()), REMOTE_EP);
@@ -357,7 +357,7 @@
   std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(0, received3);
   BOOST_REQUIRE(!isComplete);
 
-  advanceClocks(time::milliseconds(1), 600);
+  advanceClocks(1_ms, 600);
 
   std::tie(isComplete, std::ignore, std::ignore) = reassembler.receiveFragment(0, received2);
   BOOST_REQUIRE(!isComplete);
diff --git a/tests/daemon/face/lp-reliability.t.cpp b/tests/daemon/face/lp-reliability.t.cpp
index 8ec1dd0..f995174 100644
--- a/tests/daemon/face/lp-reliability.t.cpp
+++ b/tests/daemon/face/lp-reliability.t.cpp
@@ -198,7 +198,7 @@
 
   // T+500ms
   // 1024 rto: 1000ms, txSeq: 2, started T+0ms, retx 0
-  advanceClocks(time::milliseconds(1), 500);
+  advanceClocks(1_ms, 500);
   linkService->sendLpPackets({pkt2});
   BOOST_CHECK_EQUAL(transport->sentPackets.size(), 2);
 
@@ -221,7 +221,7 @@
   // T+1250ms
   // 1024 rto: 1000ms, txSeq: 4, started T+1000ms, retx 1
   // 3000 rto: 1000ms, txSeq: 3, started T+500ms, retx 0
-  advanceClocks(time::milliseconds(1), 750);
+  advanceClocks(1_ms, 750);
 
   BOOST_CHECK_EQUAL(reliability->m_unackedFrags.size(), 2);
   BOOST_CHECK_EQUAL(reliability->m_unackedFrags.count(firstTxSeq), 0);
@@ -239,7 +239,7 @@
   // T+2250ms
   // 1024 rto: 1000ms, txSeq: 6, started T+2000ms, retx 2
   // 3000 rto: 1000ms, txSeq: 5, started T+1500ms, retx 1
-  advanceClocks(time::milliseconds(1), 1000);
+  advanceClocks(1_ms, 1000);
 
   BOOST_CHECK_EQUAL(reliability->m_unackedFrags.size(), 2);
   BOOST_CHECK_EQUAL(reliability->m_unackedFrags.count(firstTxSeq + 1), 0);
@@ -258,7 +258,7 @@
   // T+3250ms
   // 1024 rto: 1000ms, txSeq: 8, started T+3000ms, retx 3
   // 3000 rto: 1000ms, txSeq: 7, started T+2500ms, retx 2
-  advanceClocks(time::milliseconds(1), 1000);
+  advanceClocks(1_ms, 1000);
 
   BOOST_CHECK_EQUAL(reliability->m_unackedFrags.size(), 2);
   BOOST_CHECK_EQUAL(reliability->m_unackedFrags.count(firstTxSeq + 3), 0);
@@ -277,7 +277,7 @@
   // T+4250ms
   // 1024 rto: expired, removed
   // 3000 rto: 1000ms, txSeq: 9, started T+3500ms, retx 3
-  advanceClocks(time::milliseconds(1), 1000);
+  advanceClocks(1_ms, 1000);
 
   BOOST_CHECK_EQUAL(reliability->m_unackedFrags.size(), 1);
   BOOST_CHECK_EQUAL(reliability->m_unackedFrags.count(firstTxSeq + 5), 0);
@@ -295,7 +295,7 @@
   // T+4750ms
   // 1024 rto: expired, removed
   // 3000 rto: expired, removed
-  advanceClocks(time::milliseconds(1), 1000);
+  advanceClocks(1_ms, 1000);
 
   BOOST_CHECK_EQUAL(reliability->m_unackedFrags.size(), 0);
   BOOST_CHECK_EQUAL(reliability->m_ackQueue.size(), 0);
@@ -367,7 +367,7 @@
   // 2048 rto: 1000ms, txSeq: 2, started T+0ms, retx 0
   // 2049 rto: 1000ms, txSeq: 5, started T+250ms, retx 1
   // 2050 rto: 1000ms, txSeq: 4, started T+0ms, retx 0
-  advanceClocks(time::milliseconds(1), 250);
+  advanceClocks(1_ms, 250);
   reliability->onLpPacketLost(3);
 
   BOOST_CHECK_EQUAL(reliability->m_unackedFrags.count(2), 1);
@@ -401,7 +401,7 @@
   // 2048 rto: 1000ms, txSeq: 2, started T+0ms, retx 0
   // 2049 rto: 1000ms, txSeq: 6, started T+500ms, retx 2
   // 2050 rto: 1000ms, txSeq: 4, started T+0ms, retx 0
-  advanceClocks(time::milliseconds(1), 250);
+  advanceClocks(1_ms, 250);
   reliability->onLpPacketLost(5);
 
   BOOST_CHECK_EQUAL(reliability->m_unackedFrags.count(2), 1);
@@ -435,7 +435,7 @@
   // 2048 rto: 1000ms, txSeq: 2, started T+0ms, retx 0
   // 2049 rto: 1000ms, txSeq: 7, started T+750ms, retx 3
   // 2050 rto: 1000ms, txSeq: 4, started T+0ms, retx 0
-  advanceClocks(time::milliseconds(1), 250);
+  advanceClocks(1_ms, 250);
   reliability->onLpPacketLost(6);
 
   BOOST_REQUIRE_EQUAL(reliability->m_unackedFrags.count(2), 1);
@@ -469,7 +469,7 @@
   // 2048 rto: expired, removed
   // 2049 rto: expired, removed
   // 2050 rto: expired, removed
-  advanceClocks(time::milliseconds(1), 100);
+  advanceClocks(1_ms, 100);
   reliability->onLpPacketLost(7);
 
   BOOST_CHECK_EQUAL(reliability->m_unackedFrags.size(), 0);
@@ -698,13 +698,13 @@
 
   linkService->sendLpPackets({makeFrag(1, 50)});
 
-  advanceClocks(time::milliseconds(1), 500);
+  advanceClocks(1_ms, 500);
 
   lp::Packet ackPkt;
   ackPkt.add<lp::AckField>(1);
   reliability->processIncomingPacket(ackPkt);
 
-  advanceClocks(time::milliseconds(1), 1000);
+  advanceClocks(1_ms, 1000);
 
   BOOST_CHECK_EQUAL(linkService->getCounters().nAcknowledged, 1);
   BOOST_CHECK_EQUAL(linkService->getCounters().nRetransmitted, 0);
@@ -737,7 +737,7 @@
   BOOST_CHECK_EQUAL(reliability->m_ackQueue.back(), 234567);
 
   // T+5ms
-  advanceClocks(time::milliseconds(1), 5);
+  advanceClocks(1_ms, 5);
   BOOST_CHECK(!reliability->m_isIdleAckTimerRunning);
 }
 
@@ -827,7 +827,7 @@
   BOOST_CHECK(reliability->m_isIdleAckTimerRunning);
 
   // T+1ms
-  advanceClocks(time::milliseconds(1), 1);
+  advanceClocks(1_ms, 1);
   BOOST_CHECK(reliability->m_isIdleAckTimerRunning);
 
   lp::Packet pkt2 = makeFrag(2, 100);
@@ -836,7 +836,7 @@
   BOOST_CHECK(reliability->m_isIdleAckTimerRunning);
 
   // T+5ms
-  advanceClocks(time::milliseconds(1), 4);
+  advanceClocks(1_ms, 4);
   BOOST_CHECK(!reliability->m_isIdleAckTimerRunning);
 
   lp::Packet pkt3 = makeFrag(3, 100);
@@ -845,11 +845,11 @@
   BOOST_CHECK(reliability->m_isIdleAckTimerRunning);
 
   // T+9ms
-  advanceClocks(time::milliseconds(1), 4);
+  advanceClocks(1_ms, 4);
   BOOST_CHECK(reliability->m_isIdleAckTimerRunning);
 
   // T+10ms
-  advanceClocks(time::milliseconds(1), 1);
+  advanceClocks(1_ms, 1);
   BOOST_CHECK(!reliability->m_isIdleAckTimerRunning);
 }
 
@@ -866,7 +866,7 @@
   BOOST_CHECK(reliability->m_isIdleAckTimerRunning);
 
   // T+4ms: idle ack timer has not yet expired, no IDLE packet generated
-  advanceClocks(time::milliseconds(1), 4);
+  advanceClocks(1_ms, 4);
   BOOST_CHECK(reliability->m_isIdleAckTimerRunning);
   BOOST_CHECK_EQUAL(reliability->m_ackQueue.size(), 500);
   BOOST_CHECK_EQUAL(reliability->m_ackQueue.front(), 1000);
@@ -874,7 +874,7 @@
   BOOST_CHECK_EQUAL(transport->sentPackets.size(), 0);
 
   // T+5ms: idle ack timer expires, IDLE packet generated
-  advanceClocks(time::milliseconds(1), 1);
+  advanceClocks(1_ms, 1);
   BOOST_CHECK(!reliability->m_isIdleAckTimerRunning);
   BOOST_CHECK_EQUAL(reliability->m_ackQueue.size(), 0);
   BOOST_REQUIRE_EQUAL(transport->sentPackets.size(), 1);
@@ -902,7 +902,7 @@
   BOOST_CHECK(reliability->m_isIdleAckTimerRunning);
 
   // T+4ms: idle ack timer has not yet expired, no IDLE packet generated
-  advanceClocks(time::milliseconds(1), 4);
+  advanceClocks(1_ms, 4);
   BOOST_CHECK(reliability->m_isIdleAckTimerRunning);
   BOOST_CHECK_EQUAL(reliability->m_ackQueue.size(), 500);
   BOOST_CHECK_EQUAL(reliability->m_ackQueue.front(), 1000);
@@ -910,7 +910,7 @@
   BOOST_CHECK_EQUAL(transport->sentPackets.size(), 0);
 
   // T+5ms: idle ack timer expires, IDLE packets generated
-  advanceClocks(time::milliseconds(1), 1);
+  advanceClocks(1_ms, 1);
   BOOST_CHECK(!reliability->m_isIdleAckTimerRunning);
   BOOST_CHECK_EQUAL(reliability->m_ackQueue.size(), 0);
 
diff --git a/tests/daemon/face/multicast-ethernet-transport.t.cpp b/tests/daemon/face/multicast-ethernet-transport.t.cpp
index 220274c..db248ac 100644
--- a/tests/daemon/face/multicast-ethernet-transport.t.cpp
+++ b/tests/daemon/face/multicast-ethernet-transport.t.cpp
@@ -107,7 +107,7 @@
     limitedIo.afterOp();
   });
 
-  BOOST_REQUIRE_EQUAL(limitedIo.run(1, time::seconds(1)), LimitedIo::EXCEED_OPS);
+  BOOST_REQUIRE_EQUAL(limitedIo.run(1, 1_s), LimitedIo::EXCEED_OPS);
 }
 
 BOOST_AUTO_TEST_CASE(SendQueueLength)
diff --git a/tests/daemon/face/multicast-udp-transport-fixture.hpp b/tests/daemon/face/multicast-udp-transport-fixture.hpp
index 775b12d..626c37a 100644
--- a/tests/daemon/face/multicast-udp-transport-fixture.hpp
+++ b/tests/daemon/face/multicast-udp-transport-fixture.hpp
@@ -98,14 +98,14 @@
         }
         limitedIo.afterOp();
       });
-    BOOST_REQUIRE_EQUAL(limitedIo.run(1, time::seconds(1)), LimitedIo::EXCEED_OPS);
+    BOOST_REQUIRE_EQUAL(limitedIo.run(1, 1_s), LimitedIo::EXCEED_OPS);
   }
 
   void
   remoteWrite(const std::vector<uint8_t>& buf, bool needToCheck = true)
   {
     sendToGroup(remoteSockTx, buf, needToCheck);
-    limitedIo.defer(time::seconds(1));
+    limitedIo.defer(1_s);
   }
 
   void
diff --git a/tests/daemon/face/multicast-udp-transport.t.cpp b/tests/daemon/face/multicast-udp-transport.t.cpp
index d8e7a60..80d4c30 100644
--- a/tests/daemon/face/multicast-udp-transport.t.cpp
+++ b/tests/daemon/face/multicast-udp-transport.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018,  Regents of the University of California,
+ * Copyright (c) 2014-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -98,7 +98,7 @@
 
   this->sendToGroup(remoteSockTx2, buf1);
   this->sendToGroup(remoteSockTx2, buf2);
-  this->limitedIo.defer(time::seconds(1));
+  this->limitedIo.defer(1_s);
 
   BOOST_CHECK_EQUAL(this->transport->getCounters().nInPackets, 4);
   BOOST_CHECK_EQUAL(this->transport->getCounters().nInBytes, 2 * buf1.size() + 2 * buf2.size());
diff --git a/tests/daemon/face/stream-transport.t.cpp b/tests/daemon/face/stream-transport.t.cpp
index 6628b92..de32a4d 100644
--- a/tests/daemon/face/stream-transport.t.cpp
+++ b/tests/daemon/face/stream-transport.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018,  Regents of the University of California,
+ * Copyright (c) 2014-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -63,7 +63,7 @@
       this->limitedIo.afterOp();
     });
 
-  BOOST_REQUIRE_EQUAL(this->limitedIo.run(1, time::seconds(1)), LimitedIo::EXCEED_OPS);
+  BOOST_REQUIRE_EQUAL(this->limitedIo.run(1, 1_s), LimitedIo::EXCEED_OPS);
 
   BOOST_CHECK_EQUAL_COLLECTIONS(readBuf.begin(), readBuf.begin() + block1.size(), block1.begin(), block1.end());
   BOOST_CHECK_EQUAL_COLLECTIONS(readBuf.begin() + block1.size(), readBuf.end(),   block2.begin(), block2.end());
@@ -189,7 +189,7 @@
     this->limitedIo.afterOp();
   });
 
-  BOOST_REQUIRE_EQUAL(this->limitedIo.run(1, time::seconds(1)), LimitedIo::EXCEED_OPS);
+  BOOST_REQUIRE_EQUAL(this->limitedIo.run(1, 1_s), LimitedIo::EXCEED_OPS);
 }
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(RemoteClose, T, StreamTransportFixtures, T)
@@ -203,7 +203,7 @@
   });
 
   this->remoteSocket.close();
-  BOOST_REQUIRE_EQUAL(this->limitedIo.run(1, time::seconds(1)), LimitedIo::EXCEED_OPS);
+  BOOST_REQUIRE_EQUAL(this->limitedIo.run(1, 1_s), LimitedIo::EXCEED_OPS);
 
   this->transport->afterStateChange.connectSingleShot([this] (TransportState oldState, TransportState newState) {
     BOOST_CHECK_EQUAL(oldState, TransportState::CLOSING);
@@ -211,7 +211,7 @@
     this->limitedIo.afterOp();
   });
 
-  BOOST_REQUIRE_EQUAL(this->limitedIo.run(1, time::seconds(1)), LimitedIo::EXCEED_OPS);
+  BOOST_REQUIRE_EQUAL(this->limitedIo.run(1, 1_s), LimitedIo::EXCEED_OPS);
 }
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(SendQueueLength, T, StreamTransportFixtures, T)
diff --git a/tests/daemon/face/tcp-channel.t.cpp b/tests/daemon/face/tcp-channel.t.cpp
index 1c2b170..6789966 100644
--- a/tests/daemon/face/tcp-channel.t.cpp
+++ b/tests/daemon/face/tcp-channel.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018,  Regents of the University of California,
+ * Copyright (c) 2014-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -55,9 +55,9 @@
       BOOST_CHECK_EQUAL(reason.empty(), false);
       this->limitedIo.afterOp();
     },
-    time::seconds(1));
+    1_s);
 
-  BOOST_CHECK_EQUAL(this->limitedIo.run(1, time::seconds(2)), LimitedIo::EXCEED_OPS);
+  BOOST_CHECK_EQUAL(this->limitedIo.run(1, 2_s), LimitedIo::EXCEED_OPS);
   BOOST_CHECK_EQUAL(channel->size(), 0);
 }
 
diff --git a/tests/daemon/face/tcp-transport-fixture.hpp b/tests/daemon/face/tcp-transport-fixture.hpp
index 631abe1..dd77a95 100644
--- a/tests/daemon/face/tcp-transport-fixture.hpp
+++ b/tests/daemon/face/tcp-transport-fixture.hpp
@@ -86,7 +86,7 @@
       limitedIo.afterOp();
     });
 
-    BOOST_REQUIRE_EQUAL(limitedIo.run(2, time::seconds(1)), LimitedIo::EXCEED_OPS);
+    BOOST_REQUIRE_EQUAL(limitedIo.run(2, 1_s), LimitedIo::EXCEED_OPS);
 
     localEp = sock.local_endpoint();
 
@@ -115,7 +115,7 @@
           BOOST_REQUIRE_EQUAL(error, boost::system::errc::success);
         }
       });
-    limitedIo.defer(time::seconds(1));
+    limitedIo.defer(1_s);
   }
 
 protected:
diff --git a/tests/daemon/face/tcp-udp-channel.t.cpp b/tests/daemon/face/tcp-udp-channel.t.cpp
index f883f22..5b86e9d 100644
--- a/tests/daemon/face/tcp-udp-channel.t.cpp
+++ b/tests/daemon/face/tcp-udp-channel.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-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -83,7 +83,7 @@
   auto ch1 = this->makeChannel(typename T::Address());
   this->connect(*ch1);
 
-  BOOST_CHECK_EQUAL(this->limitedIo.run(2, time::seconds(1)), LimitedIo::EXCEED_OPS);
+  BOOST_CHECK_EQUAL(this->limitedIo.run(2, 1_s), LimitedIo::EXCEED_OPS);
 
   BOOST_CHECK_EQUAL(this->listenerChannel->size(), 1);
   BOOST_CHECK_EQUAL(ch1->size(), 1);
@@ -94,7 +94,7 @@
   this->connect(*ch2);
   this->connect(*ch3);
 
-  BOOST_CHECK_EQUAL(this->limitedIo.run(4, time::seconds(2)), LimitedIo::EXCEED_OPS);
+  BOOST_CHECK_EQUAL(this->limitedIo.run(4, 2_s), LimitedIo::EXCEED_OPS);
 
   BOOST_CHECK_EQUAL(this->listenerChannel->size(), 3);
   BOOST_CHECK_EQUAL(ch1->size(), 1);
@@ -113,7 +113,7 @@
   // connect twice to the same endpoint
   this->connect(*ch3);
 
-  BOOST_CHECK_EQUAL(this->limitedIo.run(1, time::seconds(1)), LimitedIo::EXCEED_OPS);
+  BOOST_CHECK_EQUAL(this->limitedIo.run(1, 1_s), LimitedIo::EXCEED_OPS);
 
   BOOST_CHECK_EQUAL(this->listenerChannel->size(), 3);
   BOOST_CHECK_EQUAL(ch1->size(), 1);
@@ -132,14 +132,14 @@
   auto clientChannel = this->makeChannel(typename T::Address());
   this->connect(*clientChannel);
 
-  BOOST_CHECK_EQUAL(this->limitedIo.run(2, time::seconds(1)), LimitedIo::EXCEED_OPS);
+  BOOST_CHECK_EQUAL(this->limitedIo.run(2, 1_s), LimitedIo::EXCEED_OPS);
 
   BOOST_CHECK_EQUAL(this->listenerChannel->size(), 1);
   BOOST_CHECK_EQUAL(clientChannel->size(), 1);
 
   this->clientFaces.at(0)->close();
 
-  BOOST_CHECK_EQUAL(this->limitedIo.run(2, time::seconds(5)), LimitedIo::EXCEED_OPS);
+  BOOST_CHECK_EQUAL(this->limitedIo.run(2, 5_s), LimitedIo::EXCEED_OPS);
 
   BOOST_CHECK_EQUAL(this->listenerChannel->size(), 0);
   BOOST_CHECK_EQUAL(clientChannel->size(), 0);
diff --git a/tests/daemon/face/transport.t.cpp b/tests/daemon/face/transport.t.cpp
index d586c20..747622e 100644
--- a/tests/daemon/face/transport.t.cpp
+++ b/tests/daemon/face/transport.t.cpp
@@ -45,6 +45,7 @@
 namespace tests {
 
 namespace mpl = boost::mpl;
+using namespace nfd::tests;
 
 BOOST_AUTO_TEST_SUITE(Face)
 BOOST_AUTO_TEST_SUITE(TestTransport)
@@ -211,7 +212,7 @@
   BOOST_CHECK_EQUAL(transport->getExpirationTime(), time::steady_clock::TimePoint::max());
 }
 
-class DummyTransportFixture : public nfd::tests::GlobalIoFixture
+class DummyTransportFixture : public GlobalIoFixture
 {
 protected:
   DummyTransportFixture()
diff --git a/tests/daemon/face/udp-channel-fixture.hpp b/tests/daemon/face/udp-channel-fixture.hpp
index 708813a..81d75f3 100644
--- a/tests/daemon/face/udp-channel-fixture.hpp
+++ b/tests/daemon/face/udp-channel-fixture.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018,  Regents of the University of California,
+ * Copyright (c) 2014-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -44,7 +44,7 @@
     if (port == 0)
       port = getNextPort();
 
-    return make_unique<UdpChannel>(udp::Endpoint(addr, port), time::seconds(2), false);
+    return make_unique<UdpChannel>(udp::Endpoint(addr, port), 2_s, false);
   }
 
   void
diff --git a/tests/daemon/face/unicast-ethernet-transport.t.cpp b/tests/daemon/face/unicast-ethernet-transport.t.cpp
index a95c3fb..0a4885d 100644
--- a/tests/daemon/face/unicast-ethernet-transport.t.cpp
+++ b/tests/daemon/face/unicast-ethernet-transport.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018,  Regents of the University of California,
+ * Copyright (c) 2014-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -89,7 +89,7 @@
     limitedIo.afterOp();
   });
 
-  BOOST_REQUIRE_EQUAL(limitedIo.run(1, time::seconds(1)), LimitedIo::EXCEED_OPS);
+  BOOST_REQUIRE_EQUAL(limitedIo.run(1, 1_s), LimitedIo::EXCEED_OPS);
 }
 
 BOOST_AUTO_TEST_CASE(IdleClose)
@@ -116,7 +116,7 @@
       limitedIo.afterOp();
     });
 
-  BOOST_REQUIRE_EQUAL(limitedIo.run(2, time::seconds(5)), LimitedIo::EXCEED_OPS);
+  BOOST_REQUIRE_EQUAL(limitedIo.run(2, 5_s), LimitedIo::EXCEED_OPS);
   BOOST_CHECK_EQUAL(nStateChanges, 2);
 }
 
diff --git a/tests/daemon/face/unicast-udp-transport-fixture.hpp b/tests/daemon/face/unicast-udp-transport-fixture.hpp
index 08acd46..dcd99ef 100644
--- a/tests/daemon/face/unicast-udp-transport-fixture.hpp
+++ b/tests/daemon/face/unicast-udp-transport-fixture.hpp
@@ -63,7 +63,7 @@
 
     face = make_unique<Face>(
              make_unique<DummyReceiveLinkService>(),
-             make_unique<UnicastUdpTransport>(std::move(sock), persistency, time::seconds(3)));
+             make_unique<UnicastUdpTransport>(std::move(sock), persistency, 3_s));
     transport = static_cast<UnicastUdpTransport*>(face->getTransport());
     receivedPackets = &static_cast<DummyReceiveLinkService*>(face->getLinkService())->receivedPackets;
 
@@ -90,7 +90,7 @@
         }
         limitedIo.afterOp();
       });
-    BOOST_REQUIRE_EQUAL(limitedIo.run(1, time::seconds(1)), LimitedIo::EXCEED_OPS);
+    BOOST_REQUIRE_EQUAL(limitedIo.run(1, 1_s), LimitedIo::EXCEED_OPS);
   }
 
   void
@@ -102,7 +102,7 @@
           BOOST_REQUIRE_EQUAL(error, boost::system::errc::success);
         }
       });
-    limitedIo.defer(time::seconds(1));
+    limitedIo.defer(1_s);
   }
 
 protected:
diff --git a/tests/daemon/face/unicast-udp-transport.t.cpp b/tests/daemon/face/unicast-udp-transport.t.cpp
index a2a3e79..9ef5b95 100644
--- a/tests/daemon/face/unicast-udp-transport.t.cpp
+++ b/tests/daemon/face/unicast-udp-transport.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018,  Regents of the University of California,
+ * Copyright (c) 2014-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -101,7 +101,7 @@
       limitedIo.afterOp();
     });
 
-  BOOST_REQUIRE_EQUAL(limitedIo.run(2, time::seconds(8)), LimitedIo::EXCEED_OPS);
+  BOOST_REQUIRE_EQUAL(limitedIo.run(2, 8_s), LimitedIo::EXCEED_OPS);
   BOOST_CHECK_EQUAL(nStateChanges, 2);
 }
 
@@ -124,7 +124,7 @@
   remoteSocket.close();
   Transport::Packet pkt(ndn::encoding::makeStringBlock(300, "hello"));
   transport->send(std::move(pkt)); // trigger ICMP error
-  BOOST_REQUIRE_EQUAL(limitedIo.run(1, time::seconds(1)), LimitedIo::EXCEED_OPS);
+  BOOST_REQUIRE_EQUAL(limitedIo.run(1, 1_s), LimitedIo::EXCEED_OPS);
 
   transport->afterStateChange.connectSingleShot([this] (TransportState oldState, TransportState newState) {
     BOOST_CHECK_EQUAL(oldState, TransportState::FAILED);
@@ -132,7 +132,7 @@
     this->limitedIo.afterOp();
   });
 
-  BOOST_REQUIRE_EQUAL(limitedIo.run(1, time::seconds(1)), LimitedIo::EXCEED_OPS);
+  BOOST_REQUIRE_EQUAL(limitedIo.run(1, 1_s), LimitedIo::EXCEED_OPS);
 }
 
 BOOST_FIXTURE_TEST_CASE(RemoteClosePermanent, RemoteCloseFixture)
@@ -146,7 +146,7 @@
   BOOST_CHECK_EQUAL(transport->getCounters().nOutPackets, 1);
   BOOST_CHECK_EQUAL(transport->getCounters().nOutBytes, block1.size());
 
-  limitedIo.defer(time::seconds(1));
+  limitedIo.defer(1_s);
   BOOST_CHECK_EQUAL(transport->getState(), TransportState::UP);
 
   remoteConnect();
@@ -161,7 +161,7 @@
       BOOST_REQUIRE_EQUAL(error, boost::system::errc::success);
       limitedIo.afterOp();
     });
-  BOOST_REQUIRE_EQUAL(limitedIo.run(1, time::seconds(1)), LimitedIo::EXCEED_OPS);
+  BOOST_REQUIRE_EQUAL(limitedIo.run(1, 1_s), LimitedIo::EXCEED_OPS);
 
   BOOST_CHECK_EQUAL_COLLECTIONS(readBuf.begin(), readBuf.end(), block1.begin(), block1.end());
 
diff --git a/tests/daemon/face/unix-stream-channel.t.cpp b/tests/daemon/face/unix-stream-channel.t.cpp
index 8e20a26..fe9d4be 100644
--- a/tests/daemon/face/unix-stream-channel.t.cpp
+++ b/tests/daemon/face/unix-stream-channel.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018,  Regents of the University of California,
+ * Copyright (c) 2014-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -108,7 +108,7 @@
   local::stream_protocol::socket client1(g_io);
   this->clientConnect(client1);
 
-  BOOST_CHECK_EQUAL(limitedIo.run(2, time::seconds(1)), LimitedIo::EXCEED_OPS);
+  BOOST_CHECK_EQUAL(limitedIo.run(2, 1_s), LimitedIo::EXCEED_OPS);
   BOOST_CHECK_EQUAL(listenerChannel->size(), 1);
 
   local::stream_protocol::socket client2(g_io);
@@ -116,7 +116,7 @@
   this->clientConnect(client2);
   this->clientConnect(client3);
 
-  BOOST_CHECK_EQUAL(limitedIo.run(4, time::seconds(1)), LimitedIo::EXCEED_OPS);
+  BOOST_CHECK_EQUAL(limitedIo.run(4, 1_s), LimitedIo::EXCEED_OPS);
   BOOST_CHECK_EQUAL(listenerChannel->size(), 3);
   BOOST_CHECK_EQUAL(listenerFaces.size(), 3);
 
diff --git a/tests/daemon/face/unix-stream-transport-fixture.hpp b/tests/daemon/face/unix-stream-transport-fixture.hpp
index 582db48..74c1b45 100644
--- a/tests/daemon/face/unix-stream-transport-fixture.hpp
+++ b/tests/daemon/face/unix-stream-transport-fixture.hpp
@@ -109,7 +109,7 @@
       limitedIo.afterOp();
     });
 
-    BOOST_REQUIRE_EQUAL(limitedIo.run(2, time::seconds(1)), LimitedIo::EXCEED_OPS);
+    BOOST_REQUIRE_EQUAL(limitedIo.run(2, 1_s), LimitedIo::EXCEED_OPS);
 
     localEp = sock.local_endpoint();
     face = make_unique<Face>(make_unique<DummyReceiveLinkService>(),
@@ -129,7 +129,7 @@
           BOOST_REQUIRE_EQUAL(error, boost::system::errc::success);
         }
       });
-    limitedIo.defer(time::seconds(1));
+    limitedIo.defer(1_s);
   }
 
 protected:
diff --git a/tests/daemon/face/websocket-transport-fixture.hpp b/tests/daemon/face/websocket-transport-fixture.hpp
index 8b8ee42..07763cd 100644
--- a/tests/daemon/face/websocket-transport-fixture.hpp
+++ b/tests/daemon/face/websocket-transport-fixture.hpp
@@ -56,7 +56,7 @@
    */
   void
   serverListen(const ip::tcp::endpoint& ep,
-               const time::milliseconds& pongTimeout = time::seconds(1))
+               const time::milliseconds& pongTimeout = 1_s)
   {
     server.clear_access_channels(websocketpp::log::alevel::all);
     server.clear_error_channels(websocketpp::log::elevel::all);
@@ -99,15 +99,15 @@
    */
   void
   initialize(ip::address address,
-             time::milliseconds pingInterval = time::seconds(10),
-             time::milliseconds pongTimeout = time::seconds(1))
+             time::milliseconds pingInterval = 10_s,
+             time::milliseconds pongTimeout = 1_s)
   {
     ip::tcp::endpoint ep(address, 20070);
     serverListen(ep, pongTimeout);
     clientConnect(FaceUri(ep, "ws").toString());
 
     BOOST_REQUIRE_EQUAL(limitedIo.run(2, // serverHandleOpen, clientHandleOpen
-                        time::seconds(1)), LimitedIo::EXCEED_OPS);
+                                      1_s), LimitedIo::EXCEED_OPS);
 
     face = make_unique<Face>(
              make_unique<DummyReceiveLinkService>(),
diff --git a/tests/daemon/face/websocket-transport.t.cpp b/tests/daemon/face/websocket-transport.t.cpp
index 66a3d43..657df71 100644
--- a/tests/daemon/face/websocket-transport.t.cpp
+++ b/tests/daemon/face/websocket-transport.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018,  Regents of the University of California,
+ * Copyright (c) 2014-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -92,10 +92,10 @@
 
 BOOST_FIXTURE_TEST_CASE_TEMPLATE(PingPong, T, WebSocketTransportFixtures, T)
 {
-  TRANSPORT_TEST_INIT(time::milliseconds(500), time::milliseconds(300));
+  TRANSPORT_TEST_INIT(500_ms, 300_ms);
 
   BOOST_CHECK_EQUAL(this->limitedIo.run(2, // clientHandlePing, serverHandlePong
-                    time::milliseconds(1500)), LimitedIo::EXCEED_OPS);
+                                        1500_ms), LimitedIo::EXCEED_OPS);
 
   BOOST_CHECK_EQUAL(this->transport->getState(), TransportState::UP);
   BOOST_CHECK_EQUAL(this->transport->getCounters().nOutPings, 1);
@@ -103,7 +103,7 @@
 
   this->clientShouldPong = false;
   BOOST_CHECK_EQUAL(this->limitedIo.run(2, // clientHandlePing, serverHandlePongTimeout
-                    time::seconds(2)), LimitedIo::EXCEED_OPS);
+                                        2_s), LimitedIo::EXCEED_OPS);
 
   BOOST_CHECK_MESSAGE(this->transport->getState() == TransportState::FAILED ||
                       this->transport->getState() == TransportState::CLOSED,
@@ -119,14 +119,14 @@
   auto block1 = ndn::encoding::makeStringBlock(300, "hello");
   this->transport->send(Transport::Packet{Block{block1}}); // make a copy of the block
   BOOST_CHECK_EQUAL(this->limitedIo.run(1, // clientHandleMessage
-                    time::seconds(1)), LimitedIo::EXCEED_OPS);
+                                        1_s), LimitedIo::EXCEED_OPS);
   BOOST_CHECK_EQUAL(this->transport->getCounters().nOutPackets, 1);
   BOOST_CHECK_EQUAL(this->transport->getCounters().nOutBytes, block1.size());
 
   auto block2 = ndn::encoding::makeStringBlock(301, "world");
   this->transport->send(Transport::Packet{Block{block2}}); // make a copy of the block
   BOOST_CHECK_EQUAL(this->limitedIo.run(1, // clientHandleMessage
-                    time::seconds(1)), LimitedIo::EXCEED_OPS);
+                                        1_s), LimitedIo::EXCEED_OPS);
   BOOST_CHECK_EQUAL(this->transport->getCounters().nOutPackets, 2);
   BOOST_CHECK_EQUAL(this->transport->getCounters().nOutBytes, block1.size() + block2.size());
 
@@ -149,12 +149,12 @@
   Block pkt1 = ndn::encoding::makeStringBlock(300, "hello");
   this->client.send(this->clientHdl, pkt1.wire(), pkt1.size(), websocketpp::frame::opcode::binary);
   BOOST_CHECK_EQUAL(this->limitedIo.run(1, // serverHandleMessage
-                    time::seconds(1)), LimitedIo::EXCEED_OPS);
+                                        1_s), LimitedIo::EXCEED_OPS);
 
   Block pkt2 = ndn::encoding::makeStringBlock(301, "world!");
   this->client.send(this->clientHdl, pkt2.wire(), pkt2.size(), websocketpp::frame::opcode::binary);
   BOOST_CHECK_EQUAL(this->limitedIo.run(1, // serverHandleMessage
-                    time::seconds(1)), LimitedIo::EXCEED_OPS);
+                                        1_s), LimitedIo::EXCEED_OPS);
 
   BOOST_CHECK_EQUAL(this->transport->getCounters().nInPackets, 2);
   BOOST_CHECK_EQUAL(this->transport->getCounters().nInBytes, pkt1.size() + pkt2.size());
@@ -175,7 +175,7 @@
   this->client.send(this->clientHdl, pkt1.wire(), pkt1.size() - 1, // truncated
                     websocketpp::frame::opcode::binary);
   BOOST_CHECK_EQUAL(this->limitedIo.run(1, // serverHandleMessage
-                    time::seconds(1)), LimitedIo::EXCEED_OPS);
+                                        1_s), LimitedIo::EXCEED_OPS);
 
   // bad packet is dropped
   BOOST_CHECK_EQUAL(this->transport->getState(), TransportState::UP);
@@ -184,7 +184,7 @@
   Block pkt2 = ndn::encoding::makeStringBlock(301, "world!");
   this->client.send(this->clientHdl, pkt2.wire(), pkt2.size(), websocketpp::frame::opcode::binary);
   BOOST_CHECK_EQUAL(this->limitedIo.run(1, // serverHandleMessage
-                    time::seconds(1)), LimitedIo::EXCEED_OPS);
+                                        1_s), LimitedIo::EXCEED_OPS);
 
   // next valid packet is still received normally
   BOOST_CHECK_EQUAL(this->transport->getState(), TransportState::UP);
@@ -242,7 +242,7 @@
 
   this->client.close(this->clientHdl, websocketpp::close::status::going_away, "");
   BOOST_CHECK_EQUAL(this->limitedIo.run(1, // serverHandleClose
-                    time::seconds(1)), LimitedIo::EXCEED_OPS);
+                                        1_s), LimitedIo::EXCEED_OPS);
 
   BOOST_CHECK_EQUAL(nStateChanges, 2);
 }
diff --git a/tests/daemon/fw/access-strategy.t.cpp b/tests/daemon/fw/access-strategy.t.cpp
index d950fc2..afa73b6 100644
--- a/tests/daemon/fw/access-strategy.t.cpp
+++ b/tests/daemon/fw/access-strategy.t.cpp
@@ -32,10 +32,8 @@
 namespace fw {
 namespace tests {
 
-using namespace nfd::tests;
-
 // The tester is unused in this file, but it's used in various templated test suites.
-typedef StrategyTester<AccessStrategy> AccessStrategyTester;
+using AccessStrategyTester = StrategyTester<AccessStrategy>;
 NFD_REGISTER_STRATEGY(AccessStrategyTester);
 
 // This test suite tests AccessStrategy's behavior as a black box,
@@ -73,8 +71,8 @@
 
     topo.setStrategy<fw::AccessStrategy>(router);
 
-    linkA = topo.addLink("RA", time::milliseconds(10), {router, laptopA});
-    linkB = topo.addLink("RB", time::milliseconds(20), {router, laptopB});
+    linkA = topo.addLink("RA", 10_ms, {router, laptopA});
+    linkB = topo.addLink("RB", 20_ms, {router, laptopB});
   }
 
 protected:
@@ -124,10 +122,9 @@
   topo.addEchoProducer(producer->getClientFace());
 
   shared_ptr<TopologyAppLink> consumer = topo.addAppFace("c", router);
-  topo.addIntervalConsumer(consumer->getClientFace(), "ndn:/laptops/A",
-                           time::milliseconds(100), 100);
+  topo.addIntervalConsumer(consumer->getClientFace(), "ndn:/laptops/A", 100_ms, 100);
 
-  this->advanceClocks(time::milliseconds(5), time::seconds(12));
+  this->advanceClocks(5_ms, 12_s);
 
   // most Interests should be satisfied, and few Interests can go to wrong laptop
   BOOST_CHECK_GE(consumer->getForwarderFace().getCounters().nOutData, 97);
@@ -171,10 +168,9 @@
   topo.addEchoProducer(producerB->getClientFace());
 
   shared_ptr<TopologyAppLink> consumer = topo.addAppFace("c", router);
-  topo.addIntervalConsumer(consumer->getClientFace(), "ndn:/laptops/BOTH",
-                           time::milliseconds(100), 100);
+  topo.addIntervalConsumer(consumer->getClientFace(), "ndn:/laptops/BOTH", 100_ms, 100);
 
-  this->advanceClocks(time::milliseconds(5), time::seconds(12));
+  this->advanceClocks(5_ms, 12_s);
 
   // most Interests should be satisfied, and few Interests can go to slower laptopB
   BOOST_CHECK_GE(consumer->getForwarderFace().getCounters().nOutData, 97);
@@ -218,12 +214,11 @@
   topo.addEchoProducer(producerB->getClientFace());
 
   shared_ptr<TopologyAppLink> consumer = topo.addAppFace("c", router);
-  topo.addIntervalConsumer(consumer->getClientFace(), "ndn:/laptops/M",
-                           time::milliseconds(100), 100);
+  topo.addIntervalConsumer(consumer->getClientFace(), "ndn:/laptops/M", 100_ms, 100);
 
   // producer is initially on laptopA
   producerB->fail();
-  this->advanceClocks(time::milliseconds(5), time::seconds(6));
+  this->advanceClocks(5_ms, 6_s);
 
   // few Interests can go to laptopB
   BOOST_CHECK_LE(linkB->getFace(router).getCounters().nOutInterests, 5);
@@ -232,7 +227,7 @@
   producerA->fail();
   producerB->recover();
   PacketCounter::rep nInterestsToA_beforeMove = linkA->getFace(router).getCounters().nOutInterests;
-  this->advanceClocks(time::milliseconds(5), time::seconds(6));
+  this->advanceClocks(5_ms, 6_s);
 
   // few additional Interests can go to laptopA
   BOOST_CHECK_LE(linkA->getFace(router).getCounters().nOutInterests - nInterestsToA_beforeMove, 5);
@@ -274,13 +269,11 @@
   topo.addEchoProducer(producerB->getClientFace());
 
   shared_ptr<TopologyAppLink> consumerAB = topo.addAppFace("cAB", laptopA);
-  topo.addIntervalConsumer(consumerAB->getClientFace(), "ndn:/laptops/B",
-                           time::milliseconds(100), 100);
+  topo.addIntervalConsumer(consumerAB->getClientFace(), "ndn:/laptops/B", 100_ms, 100);
   shared_ptr<TopologyAppLink> consumerBA = topo.addAppFace("cBA", laptopB);
-  topo.addIntervalConsumer(consumerBA->getClientFace(), "ndn:/laptops/A",
-                           time::milliseconds(100), 100);
+  topo.addIntervalConsumer(consumerBA->getClientFace(), "ndn:/laptops/A", 100_ms, 100);
 
-  this->advanceClocks(time::milliseconds(5), time::seconds(12));
+  this->advanceClocks(5_ms, 12_s);
 
   // most Interests should be satisfied
   BOOST_CHECK_GE(consumerAB->getForwarderFace().getCounters().nOutData, 97);
@@ -324,7 +317,7 @@
   consumer->getClientFace().expressInterest(*interest1,
                                             bind([&hasData1] { hasData1 = true; }),
                                             nullptr, nullptr);
-  this->advanceClocks(time::milliseconds(5), time::seconds(1));
+  this->advanceClocks(5_ms, 1_s);
   BOOST_CHECK_EQUAL(hasData1, true);
 
   // Interest 2 experiences a packet loss on initial transmission
@@ -335,7 +328,7 @@
                                             nullptr,
                                             bind([&hasTimeout2a] { hasTimeout2a = true; }));
   producerA->fail();
-  this->advanceClocks(time::milliseconds(5), time::milliseconds(60));
+  this->advanceClocks(5_ms, 60_ms);
   BOOST_CHECK_EQUAL(hasData2a, false);
   BOOST_CHECK_EQUAL(hasTimeout2a, false);
 
@@ -346,7 +339,7 @@
                                             bind([&hasData2b] { hasData2b = true; }),
                                             nullptr, nullptr);
   producerA->recover();
-  this->advanceClocks(time::milliseconds(5), time::seconds(1));
+  this->advanceClocks(5_ms, 1_s);
   BOOST_CHECK_EQUAL(hasData2b, false);
 
   // Interest 2 retransmission gets through, and is answered
@@ -355,7 +348,7 @@
   consumer->getClientFace().expressInterest(*interest2c,
                                             bind([&hasData2c] { hasData2c = true; }),
                                             nullptr, nullptr);
-  this->advanceClocks(time::milliseconds(5), time::seconds(1));
+  this->advanceClocks(5_ms, 1_s);
   BOOST_CHECK_EQUAL(hasData2c, true);
 }
 
@@ -367,10 +360,9 @@
 
   // send Interests from laptopA to router
   shared_ptr<TopologyAppLink> consumer = topo.addAppFace("c", laptopA);
-  topo.addIntervalConsumer(consumer->getClientFace(), "ndn:/net",
-                           time::milliseconds(100), 10);
+  topo.addIntervalConsumer(consumer->getClientFace(), "ndn:/net", 100_ms, 10);
 
-  this->advanceClocks(time::milliseconds(5), time::seconds(2));
+  this->advanceClocks(5_ms, 2_s);
 
   // Interest shouldn't loop back from router
   BOOST_CHECK_EQUAL(linkA->getFace(router).getCounters().nOutInterests, 0);
diff --git a/tests/daemon/fw/ad-hoc-forwarding.t.cpp b/tests/daemon/fw/ad-hoc-forwarding.t.cpp
index 5ef50cf..7ec07c7 100644
--- a/tests/daemon/fw/ad-hoc-forwarding.t.cpp
+++ b/tests/daemon/fw/ad-hoc-forwarding.t.cpp
@@ -42,8 +42,6 @@
 namespace fw {
 namespace tests {
 
-using namespace nfd::tests;
-
 template<typename S>
 class AdHocForwardingFixture : public GlobalIoTimeFixture
 {
@@ -58,7 +56,7 @@
       topo.setStrategy<S>(node);
     }
 
-    auto wireless = topo.addLink("ABC", time::milliseconds(10), {nodeA, nodeB, nodeC},
+    auto wireless = topo.addLink("ABC", 10_ms, {nodeA, nodeB, nodeC},
                                  ndn::nfd::LINK_TYPE_AD_HOC);
     wireless->block(nodeA, nodeC);
     wireless->block(nodeC, nodeA);
@@ -103,8 +101,8 @@
   // B should relay Interest/Data between A and C.
 
   this->topo.registerPrefix(this->nodeB, *this->faceB, "/P");
-  this->topo.addIntervalConsumer(this->appA->getClientFace(), "/P", time::milliseconds(100), 10);
-  this->advanceClocks(time::milliseconds(5), time::milliseconds(1200));
+  this->topo.addIntervalConsumer(this->appA->getClientFace(), "/P", 100_ms, 10);
+  this->advanceClocks(5_ms, 1200_ms);
 
   // Consumer should receive Data, and B should be relaying.
   BOOST_CHECK_EQUAL(this->faceB->getCounters().nInInterests, 10);
@@ -127,17 +125,17 @@
   // B's first nexthop is D, but B-D link has failed, so B should relay Interest/Data between A and C.
 
   TopologyNode nodeD = this->topo.addForwarder("D");
-  shared_ptr<TopologyLink> linkBD = this->topo.addLink("BD", time::milliseconds(5), {this->nodeB, nodeD});
+  shared_ptr<TopologyLink> linkBD = this->topo.addLink("BD", 5_ms, {this->nodeB, nodeD});
   this->topo.registerPrefix(this->nodeB, linkBD->getFace(this->nodeB), "/P", 5);
   linkBD->fail();
   this->topo.registerPrefix(this->nodeB, *this->faceB, "/P", 10);
 
   // Two interval consumers are expressing Interests with same name 40ms apart,
   // so that Interests from the second interval consumer are considered retransmission.
-  this->topo.addIntervalConsumer(this->appA->getClientFace(), "/P", time::milliseconds(100), 50, 1);
-  this->advanceClocks(time::milliseconds(5), time::milliseconds(40));
-  this->topo.addIntervalConsumer(this->appA->getClientFace(), "/P", time::milliseconds(100), 50, 1);
-  this->advanceClocks(time::milliseconds(5), time::milliseconds(5400));
+  this->topo.addIntervalConsumer(this->appA->getClientFace(), "/P", 100_ms, 50, 1);
+  this->advanceClocks(5_ms, 40_ms);
+  this->topo.addIntervalConsumer(this->appA->getClientFace(), "/P", 100_ms, 50, 1);
+  this->advanceClocks(5_ms, 5400_ms);
 
   // Consumer should receive Data, and B should be relaying at least some Interest/Data.
   BOOST_CHECK_GE(this->faceB->getCounters().nInInterests, 50);
diff --git a/tests/daemon/fw/algorithm.t.cpp b/tests/daemon/fw/algorithm.t.cpp
index cb32efc..96284f3 100644
--- a/tests/daemon/fw/algorithm.t.cpp
+++ b/tests/daemon/fw/algorithm.t.cpp
@@ -216,7 +216,7 @@
   time::steady_clock::TimePoint before = time::steady_clock::now();
 
   entry.insertOrUpdateOutRecord(*face1, 0, *interest);
-  this->advanceClocks(time::milliseconds(1000));
+  this->advanceClocks(1_s);
 
   BOOST_CHECK_EQUAL(getLastOutgoing(entry), before);
 
diff --git a/tests/daemon/fw/asf-measurements.t.cpp b/tests/daemon/fw/asf-measurements.t.cpp
index a5fee3f..d08f761 100644
--- a/tests/daemon/fw/asf-measurements.t.cpp
+++ b/tests/daemon/fw/asf-measurements.t.cpp
@@ -50,7 +50,7 @@
   BOOST_CHECK_EQUAL(stats.getSrtt(), RttStats::RTT_NO_MEASUREMENT);
 
   // Receive Data back in 50ms
-  RttEstimator::Duration rtt(time::milliseconds(50));
+  RttEstimator::Duration rtt(50_ms);
   stats.addRttMeasurement(rtt);
 
   BOOST_CHECK_EQUAL(stats.getRtt(), rtt);
@@ -63,7 +63,7 @@
   BOOST_CHECK_EQUAL(stats.getSrtt(), rtt);
 
   // Receive Data back with a higher RTT
-  RttEstimator::Duration higherRtt(time::milliseconds(100));
+  RttEstimator::Duration higherRtt(100_ms);
   stats.addRttMeasurement(higherRtt);
 
   BOOST_CHECK_EQUAL(stats.getRtt(), higherRtt);
@@ -105,7 +105,7 @@
   pitEntry->insertOrUpdateOutRecord(*face, 0, *interest);
 
   RttEstimator::Duration rtt(50);
-  this->advanceClocks(time::milliseconds(5), rtt);
+  this->advanceClocks(5_ms, rtt);
 
   info.recordRtt(pitEntry, *face);
   info.cancelTimeoutEvent(interestName);
diff --git a/tests/daemon/fw/asf-strategy.t.cpp b/tests/daemon/fw/asf-strategy.t.cpp
index d363880..27ed2aa 100644
--- a/tests/daemon/fw/asf-strategy.t.cpp
+++ b/tests/daemon/fw/asf-strategy.t.cpp
@@ -36,7 +36,7 @@
 using namespace nfd::fw::tests;
 
 // The tester is unused in this file, but it's used in various templated test suites.
-typedef StrategyTester<AsfStrategy> AsfStrategyTester;
+using AsfStrategyTester = StrategyTester<AsfStrategy>;
 NFD_REGISTER_STRATEGY(AsfStrategyTester);
 
 BOOST_AUTO_TEST_SUITE(Fw)
@@ -45,8 +45,9 @@
 class AsfGridFixture : public GlobalIoTimeFixture
 {
 protected:
-  AsfGridFixture(Name parameters = AsfStrategy::getStrategyName())
-    : parameters(parameters)
+  explicit
+  AsfGridFixture(const Name& params = AsfStrategy::getStrategyName())
+    : parameters(params)
   {
     /*
      *                  +---------+
@@ -74,10 +75,10 @@
     topo.setStrategy<AsfStrategy>(nodeC, Name("ndn:/"), parameters);
     topo.setStrategy<AsfStrategy>(nodeD, Name("ndn:/"), parameters);
 
-    linkAB = topo.addLink("AB", time::milliseconds(10), {nodeA, nodeB});
-    linkAD = topo.addLink("AD", time::milliseconds(100), {nodeA, nodeD});
-    linkBC = topo.addLink("BC", time::milliseconds(10), {nodeB, nodeC});
-    linkCD = topo.addLink("CD", time::milliseconds(100), {nodeC, nodeD});
+    linkAB = topo.addLink("AB", 10_ms, {nodeA, nodeB});
+    linkAD = topo.addLink("AD", 100_ms, {nodeA, nodeD});
+    linkBC = topo.addLink("BC", 10_ms, {nodeB, nodeC});
+    linkCD = topo.addLink("CD", 100_ms, {nodeC, nodeD});
 
     consumer = topo.addAppFace("c", nodeA);
     producer = topo.addAppFace("p", nodeC, PRODUCER_PREFIX);
@@ -91,8 +92,8 @@
   void
   runConsumer(int numInterests = 30)
   {
-    topo.addIntervalConsumer(consumer->getClientFace(), PRODUCER_PREFIX, time::seconds(1), numInterests);
-    this->advanceClocks(time::milliseconds(10), time::seconds(numInterests));
+    topo.addIntervalConsumer(consumer->getClientFace(), PRODUCER_PREFIX, 1_s, numInterests);
+    this->advanceClocks(10_ms, time::seconds(numInterests));
   }
 
 protected:
@@ -160,7 +161,7 @@
   linkAB->recover();
 
   // Advance time to ensure probing is due
-  this->advanceClocks(time::milliseconds(10), time::seconds(10));
+  this->advanceClocks(10_ms, 10_s);
 
   runConsumer();
 
@@ -229,10 +230,10 @@
     topo.setStrategy<AsfStrategy>(node);
   }
 
-  shared_ptr<TopologyLink> linkAB = topo.addLink("AB", time::milliseconds(15), {nodeA, nodeB}),
-                           linkAC = topo.addLink("AC", time::milliseconds(14), {nodeA, nodeC}),
-                           linkBC = topo.addLink("BC", time::milliseconds(16), {nodeB, nodeC}),
-                           linkBD = topo.addLink("BD", time::milliseconds(80), {nodeB, nodeD});
+  shared_ptr<TopologyLink> linkAB = topo.addLink("AB", 15_ms, {nodeA, nodeB}),
+                           linkAC = topo.addLink("AC", 14_ms, {nodeA, nodeC}),
+                           linkBC = topo.addLink("BC", 16_ms, {nodeB, nodeC}),
+                           linkBD = topo.addLink("BD", 80_ms, {nodeB, nodeD});
 
   shared_ptr<TopologyAppLink> ping = topo.addAppFace("c", nodeA),
                         pingServer = topo.addAppFace("p", nodeD, PRODUCER_PREFIX);
@@ -257,14 +258,8 @@
 
     // Don't know when the probe will be triggered since it is random between 0-5 seconds
     // or whether it will be triggered for this interest
-    int j = 1;
-    while (linkAB->getFace(nodeA).getCounters().nOutInterests != 1) {
-      this->advanceClocks(time::milliseconds(1));
-      ++j;
-      // Probe was not scheduled with this ping interest
-      if (j > 1000) {
-        break;
-      }
+    for (int j = 1; j <= 1000 && linkAB->getFace(nodeA).getCounters().nOutInterests != 1; ++j) {
+      this->advanceClocks(1_ms);
     }
 
     // Check if probe is sent to B else send another ping
@@ -286,7 +281,7 @@
       BOOST_CHECK_EQUAL(linkBD->getFace(nodeB).getCounters().nOutInterests, i - 1);
 
       // After 15ms, B should get the probe interest
-      this->advanceClocks(time::milliseconds(1), time::milliseconds(15));
+      this->advanceClocks(1_ms, 15_ms);
       BOOST_CHECK_EQUAL(linkAB->getFace(nodeB).getCounters().nInInterests, 1);
       BOOST_CHECK_EQUAL(linkBD->getFace(nodeB).getCounters().nOutInterests, i);
 
@@ -298,7 +293,7 @@
       BOOST_CHECK(outRecord != pitEntry->out_end());
 
       // RTT between B and D
-      this->advanceClocks(time::milliseconds(5), time::milliseconds(160));
+      this->advanceClocks(5_ms, 160_ms);
       outRecord = pitEntry->getOutRecord(linkBD->getFace(nodeB), 0);
 
       BOOST_CHECK_EQUAL(linkBD->getFace(nodeB).getCounters().nInData, i);
@@ -308,7 +303,7 @@
       // Data is returned for the ping after 15 ms - will result in false measurement
       // 14+16-15 = 15ms
       // Since outRecord == pitEntry->out_end()
-      this->advanceClocks(time::milliseconds(1), time::milliseconds(15));
+      this->advanceClocks(1_ms, 15_ms);
       BOOST_CHECK_EQUAL(linkBD->getFace(nodeB).getCounters().nInData, i+1);
 
       break;
@@ -352,7 +347,7 @@
   // Send 6 interests let it change to use the 10 ms link
   runConsumer(6);
 
-  shared_ptr<TopologyLink> linkAC = topo.addLink("AC", time::milliseconds(5), {nodeA, nodeD});
+  shared_ptr<TopologyLink> linkAC = topo.addLink("AC", 5_ms, {nodeA, nodeD});
   topo.registerPrefix(nodeA, linkAC->getFace(nodeA), PRODUCER_PREFIX, 1);
 
   BOOST_CHECK_EQUAL(linkAC->getFace(nodeA).getCounters().nOutInterests, 0);
diff --git a/tests/daemon/fw/best-route-strategy.t.cpp b/tests/daemon/fw/best-route-strategy.t.cpp
index 7a2db75..b11cdae 100644
--- a/tests/daemon/fw/best-route-strategy.t.cpp
+++ b/tests/daemon/fw/best-route-strategy.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2016,  Regents of the University of California,
+/*
+ * Copyright (c) 2014-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -32,10 +32,8 @@
 namespace fw {
 namespace tests {
 
-using namespace nfd::tests;
-
 // The tester is unused in this file, but it's used in various templated test suites.
-typedef StrategyTester<BestRouteStrategy> BestRouteStrategyTester;
+using BestRouteStrategyTester = StrategyTester<BestRouteStrategy>;
 NFD_REGISTER_STRATEGY(BestRouteStrategyTester);
 
 } // namespace tests
diff --git a/tests/daemon/fw/best-route-strategy2.t.cpp b/tests/daemon/fw/best-route-strategy2.t.cpp
index 4101464..5776f6c 100644
--- a/tests/daemon/fw/best-route-strategy2.t.cpp
+++ b/tests/daemon/fw/best-route-strategy2.t.cpp
@@ -34,9 +34,7 @@
 namespace fw {
 namespace tests {
 
-using namespace nfd::tests;
-
-typedef StrategyTester<BestRouteStrategy2> BestRouteStrategy2Tester;
+using BestRouteStrategy2Tester = StrategyTester<BestRouteStrategy2>;
 NFD_REGISTER_STRATEGY(BestRouteStrategy2Tester);
 
 BOOST_AUTO_TEST_SUITE(Fw)
diff --git a/tests/daemon/fw/forwarder.t.cpp b/tests/daemon/fw/forwarder.t.cpp
index 8e3bae3..59b5ef3 100644
--- a/tests/daemon/fw/forwarder.t.cpp
+++ b/tests/daemon/fw/forwarder.t.cpp
@@ -45,7 +45,7 @@
   Forwarder forwarder;
 
   shared_ptr<Interest> interestAB = makeInterest("/A/B");
-  interestAB->setInterestLifetime(time::seconds(4));
+  interestAB->setInterestLifetime(4_s);
   shared_ptr<Data> dataABC = makeData("/A/B/C");
 
   auto face1 = make_shared<DummyFace>();
@@ -61,7 +61,7 @@
   BOOST_CHECK_EQUAL(forwarder.getCounters().nCsHits, 0);
   BOOST_CHECK_EQUAL(forwarder.getCounters().nCsMisses, 0);
   face1->receiveInterest(*interestAB);
-  this->advanceClocks(time::milliseconds(100), time::seconds(1));
+  this->advanceClocks(100_ms, 1_s);
   BOOST_REQUIRE_EQUAL(face2->sentInterests.size(), 1);
   BOOST_CHECK_EQUAL(face2->sentInterests[0].getName(), "/A/B");
   BOOST_REQUIRE(face2->sentInterests[0].getTag<lp::IncomingFaceIdTag>() != nullptr);
@@ -74,7 +74,7 @@
   BOOST_CHECK_EQUAL(forwarder.getCounters().nInData, 0);
   BOOST_CHECK_EQUAL(forwarder.getCounters().nOutData, 0);
   face2->receiveData(*dataABC);
-  this->advanceClocks(time::milliseconds(100), time::seconds(1));
+  this->advanceClocks(100_ms, 1_s);
   BOOST_REQUIRE_EQUAL(face1->sentData.size(), 1);
   BOOST_CHECK_EQUAL(face1->sentData[0].getName(), "/A/B/C");
   BOOST_REQUIRE(face1->sentData[0].getTag<lp::IncomingFaceIdTag>() != nullptr);
@@ -95,7 +95,7 @@
   forwarder.addFace(face3);
 
   shared_ptr<Interest> interestA = makeInterest("/A");
-  interestA->setInterestLifetime(time::seconds(4));
+  interestA->setInterestLifetime(4_s);
   shared_ptr<Data> dataA = makeData("/A");
   dataA->setTag(make_shared<lp::IncomingFaceIdTag>(face3->getId()));
 
@@ -111,7 +111,7 @@
   BOOST_CHECK_EQUAL(forwarder.getCounters().nCsHits, 0);
   BOOST_CHECK_EQUAL(forwarder.getCounters().nCsMisses, 0);
   face1->receiveInterest(*interestA);
-  this->advanceClocks(time::milliseconds(1), time::milliseconds(5));
+  this->advanceClocks(1_ms, 5_ms);
   // Interest matching ContentStore should not be forwarded
   BOOST_REQUIRE_EQUAL(face2->sentInterests.size(), 0);
   BOOST_CHECK_EQUAL(forwarder.getCounters().nCsHits, 1);
@@ -122,7 +122,7 @@
   BOOST_REQUIRE(face1->sentData[0].getTag<lp::IncomingFaceIdTag>() != nullptr);
   BOOST_CHECK_EQUAL(*face1->sentData[0].getTag<lp::IncomingFaceIdTag>(), face::FACEID_CONTENT_STORE);
 
-  this->advanceClocks(time::milliseconds(100), time::milliseconds(500));
+  this->advanceClocks(100_ms, 500_ms);
   // PIT entry should not be left behind
   BOOST_CHECK_EQUAL(pit.size(), 0);
 }
@@ -171,7 +171,7 @@
   interest->setTag(make_shared<lp::NextHopFaceIdTag>(face2->getId()));
 
   face1->receiveInterest(*interest);
-  this->advanceClocks(time::milliseconds(100), time::seconds(1));
+  this->advanceClocks(100_ms, 1_s);
   BOOST_CHECK_EQUAL(face3->sentInterests.size(), 0);
   BOOST_REQUIRE_EQUAL(face2->sentInterests.size(), 1);
   BOOST_CHECK_EQUAL(face2->sentInterests.front().getName(), "/A/B");
@@ -282,7 +282,7 @@
   forwarder.startProcessInterest(FaceEndpoint(*face1, 0), *interest2);
   BOOST_CHECK_EQUAL(strategyB.afterReceiveInterest_count, 1);
 
-  this->advanceClocks(time::milliseconds(1), time::milliseconds(5));
+  this->advanceClocks(1_ms, 5_ms);
 
   shared_ptr<Data> data1 = makeData("ndn:/A/1/a");
   strategyA.beforeSatisfyInterest_count = 0;
@@ -295,10 +295,10 @@
   BOOST_CHECK_EQUAL(strategyB.beforeSatisfyInterest_count, 1);
 
   shared_ptr<Interest> interest3 = makeInterest("ndn:/A/3");
-  interest3->setInterestLifetime(time::milliseconds(30));
+  interest3->setInterestLifetime(30_ms);
   forwarder.startProcessInterest(FaceEndpoint(*face1, 0), *interest3);
   shared_ptr<Interest> interest4 = makeInterest("ndn:/B/4");
-  interest4->setInterestLifetime(time::milliseconds(5000));
+  interest4->setInterestLifetime(5_s);
   forwarder.startProcessInterest(FaceEndpoint(*face1, 0), *interest4);
 }
 
@@ -329,7 +329,7 @@
 
   shared_ptr<Data> dataD = makeData("ndn:/A/B/C/D");
   forwarder.onIncomingData(FaceEndpoint(*face3, 0), *dataD);
-  this->advanceClocks(time::milliseconds(1), time::milliseconds(5));
+  this->advanceClocks(1_ms, 5_ms);
 
   BOOST_CHECK_EQUAL(face1->sentData.size(), 1);
   BOOST_CHECK_EQUAL(face2->sentData.size(), 1);
@@ -557,12 +557,12 @@
   // receive an Interest
   shared_ptr<Interest> interest = makeInterest("ndn:/A/1");
   interest->setNonce(82101183);
-  interest->setInterestLifetime(time::milliseconds(50));
+  interest->setInterestLifetime(50_ms);
   face1->receiveInterest(*interest);
 
   // interest should be forwarded only once, as long as Nonce is in Dead Nonce List
-  BOOST_ASSERT(time::milliseconds(25) * 40 < forwarder.getDeadNonceList().getLifetime());
-  this->advanceClocks(time::milliseconds(25), 40);
+  BOOST_ASSERT(25_ms * 40 < forwarder.getDeadNonceList().getLifetime());
+  this->advanceClocks(25_ms, 40);
 
   BOOST_CHECK_EQUAL(face2->sentInterests.size(), 1);
 
@@ -581,7 +581,7 @@
 
   shared_ptr<Interest> interest = makeInterest("ndn:/hcLSAsQ9A");
   interest->setNonce(61883075);
-  interest->setInterestLifetime(time::seconds(2));
+  interest->setInterestLifetime(2_s);
 
   DeadNonceList& dnl = forwarder.getDeadNonceList();
   dnl.add(interest->getName(), interest->getNonce());
@@ -589,7 +589,7 @@
   BOOST_REQUIRE_EQUAL(pit.size(), 0);
 
   forwarder.startProcessInterest(FaceEndpoint(*face1, 0), *interest);
-  this->advanceClocks(time::milliseconds(100), time::seconds(20));
+  this->advanceClocks(100_ms, 20_s);
   BOOST_CHECK_EQUAL(pit.size(), 0);
 }
 
diff --git a/tests/daemon/fw/forwarding-hint.t.cpp b/tests/daemon/fw/forwarding-hint.t.cpp
index e37c267..7e9dbdc 100644
--- a/tests/daemon/fw/forwarding-hint.t.cpp
+++ b/tests/daemon/fw/forwarding-hint.t.cpp
@@ -77,12 +77,12 @@
     topo.getForwarder(nodeS).getNetworkRegionTable().insert("/ucla/cs/spurs");
     // NetworkRegionTable configuration is unnecessary on end hosts
 
-    linkAH = topo.addLink("AH", time::milliseconds(10), {nodeA, nodeH});
-    linkHT = topo.addLink("HT", time::milliseconds(10), {nodeH, nodeT});
-    linkTP = topo.addLink("TP", time::milliseconds(10), {nodeT, nodeP});
-    linkHC = topo.addLink("HC", time::milliseconds(10), {nodeH, nodeC});
-    linkCS = topo.addLink("CS", time::milliseconds(10), {nodeC, nodeS});
-    linkSQ = topo.addLink("SQ", time::milliseconds(10), {nodeS, nodeQ});
+    linkAH = topo.addLink("AH", 10_ms, {nodeA, nodeH});
+    linkHT = topo.addLink("HT", 10_ms, {nodeH, nodeT});
+    linkTP = topo.addLink("TP", 10_ms, {nodeT, nodeP});
+    linkHC = topo.addLink("HC", 10_ms, {nodeH, nodeC});
+    linkCS = topo.addLink("CS", 10_ms, {nodeC, nodeS});
+    linkSQ = topo.addLink("SQ", 10_ms, {nodeS, nodeQ});
     consumerA = topo.addAppFace("avenir", nodeA);
     producerP = topo.addAppFace("ndnsimP", nodeP, "/net/ndnsim");
     producerQ = topo.addAppFace("ndnsimQ", nodeQ, "/net/ndnsim");
@@ -123,7 +123,7 @@
 BOOST_AUTO_TEST_CASE(FetchTelia)
 {
   this->consumerExpressInterest(1);
-  this->advanceClocks(time::milliseconds(11), 20);
+  this->advanceClocks(11_ms, 20);
 
   // A forwards Interest according to default route, no change to forwarding hint
   BOOST_CHECK_EQUAL(linkAH->getFace(nodeA).getCounters().nOutInterests, 1);
@@ -152,7 +152,7 @@
   topo.getForwarder(nodeH).getFib().erase("/telia");
 
   this->consumerExpressInterest(1);
-  this->advanceClocks(time::milliseconds(11), 20);
+  this->advanceClocks(11_ms, 20);
 
   // A forwards Interest according to default route, no change to forwarding hint
   BOOST_CHECK_EQUAL(linkAH->getFace(nodeA).getCounters().nOutInterests, 1);
diff --git a/tests/daemon/fw/multicast-strategy.t.cpp b/tests/daemon/fw/multicast-strategy.t.cpp
index a6d9be6..e1c4027 100644
--- a/tests/daemon/fw/multicast-strategy.t.cpp
+++ b/tests/daemon/fw/multicast-strategy.t.cpp
@@ -34,9 +34,7 @@
 namespace fw {
 namespace tests {
 
-using namespace nfd::tests;
-
-typedef StrategyTester<MulticastStrategy> MulticastStrategyTester;
+using MulticastStrategyTester = StrategyTester<MulticastStrategy>;
 NFD_REGISTER_STRATEGY(MulticastStrategyTester);
 
 class MulticastStrategyFixture : public GlobalIoTimeFixture
diff --git a/tests/daemon/fw/ncc-strategy.t.cpp b/tests/daemon/fw/ncc-strategy.t.cpp
index 86238af..d7172e3 100644
--- a/tests/daemon/fw/ncc-strategy.t.cpp
+++ b/tests/daemon/fw/ncc-strategy.t.cpp
@@ -33,9 +33,7 @@
 namespace fw {
 namespace tests {
 
-using namespace nfd::tests;
-
-typedef StrategyTester<NccStrategy> NccStrategyTester;
+using NccStrategyTester = StrategyTester<NccStrategy>;
 NFD_REGISTER_STRATEGY(NccStrategyTester);
 
 BOOST_AUTO_TEST_SUITE(Fw)
@@ -69,7 +67,7 @@
   // first Interest: strategy knows nothing and follows routing
   shared_ptr<Interest> interest1p = makeInterest("ndn:/0Jm1ajrW/%00");
   Interest& interest1 = *interest1p;
-  interest1.setInterestLifetime(time::milliseconds(8000));
+  interest1.setInterestLifetime(8_s);
   shared_ptr<pit::Entry> pitEntry1 = pit.insert(interest1).first;
 
   pitEntry1->insertOrUpdateInRecord(*face3, 0, interest1);
@@ -81,7 +79,7 @@
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory[0].outFaceId, face1->getId());
 
   // forwards to face2 because face1 doesn't respond
-  limitedIo.run(1, time::milliseconds(500), time::milliseconds(10));
+  limitedIo.run(1, 500_ms, 10_ms);
   BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 2);
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory[1].outFaceId, face2->getId());
 
@@ -89,19 +87,19 @@
   shared_ptr<Data> data1p = makeData("ndn:/0Jm1ajrW/%00");
   Data& data1 = *data1p;
   strategy.beforeSatisfyInterest(pitEntry1, FaceEndpoint(*face2, 0), data1);
-  this->advanceClocks(time::milliseconds(10), time::milliseconds(500));
+  this->advanceClocks(10_ms, 500_ms);
 
   // second Interest: strategy knows face2 is best
   shared_ptr<Interest> interest2p = makeInterest("ndn:/0Jm1ajrW/%00%01");
   Interest& interest2 = *interest2p;
-  interest2.setInterestLifetime(time::milliseconds(8000));
+  interest2.setInterestLifetime(8_s);
   shared_ptr<pit::Entry> pitEntry2 = pit.insert(interest2).first;
 
   pitEntry2->insertOrUpdateInRecord(*face3, 0, interest2);
   strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), interest2, pitEntry2);
 
   // forwards to face2 because it responds previously
-  this->advanceClocks(time::milliseconds(1));
+  this->advanceClocks(1_ms);
   BOOST_REQUIRE_GE(strategy.sendInterestHistory.size(), 3);
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory[2].outFaceId, face2->getId());
 }
@@ -126,25 +124,25 @@
 
   // first Interest: strategy follows routing and forwards to face1
   shared_ptr<Interest> interest1 = makeInterest("ndn:/nztwIvHX/%00");
-  interest1->setInterestLifetime(time::milliseconds(8000));
+  interest1->setInterestLifetime(8_s);
   shared_ptr<pit::Entry> pitEntry1 = pit.insert(*interest1).first;
 
   pitEntry1->insertOrUpdateInRecord(*face3, 0, *interest1);
   strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), *interest1, pitEntry1);
 
-  this->advanceClocks(time::milliseconds(1));
+  this->advanceClocks(1_ms);
   BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 1);
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory[0].outFaceId, face1->getId());
 
   // face1 responds
   shared_ptr<Data> data1 = makeData("ndn:/nztwIvHX/%00");
   strategy.beforeSatisfyInterest(pitEntry1, FaceEndpoint(*face1, 0), *data1);
-  this->advanceClocks(time::milliseconds(10), time::milliseconds(500));
+  this->advanceClocks(10_ms, 500_ms);
 
   // second Interest: bestFace is face1, nUpstreams becomes 0,
   // therefore pitEntryInfo->maxInterval cannot be calculated from deferRange and nUpstreams
   shared_ptr<Interest> interest2 = makeInterest("ndn:/nztwIvHX/%01");
-  interest2->setInterestLifetime(time::milliseconds(8000));
+  interest2->setInterestLifetime(8_s);
   shared_ptr<pit::Entry> pitEntry2 = pit.insert(*interest2).first;
 
   pitEntry2->insertOrUpdateInRecord(*face3, 0, *interest2);
@@ -152,7 +150,7 @@
 
   // FIB entry is changed before doPropagate executes
   fibEntry.addOrUpdateNextHop(*face2, 0, 20);
-  this->advanceClocks(time::milliseconds(10), time::milliseconds(1000));// should not crash
+  this->advanceClocks(10_ms, 1_s);// should not crash
 }
 
 BOOST_AUTO_TEST_CASE(Bug1961)
@@ -178,13 +176,12 @@
 
   // first Interest: strategy forwards to face1 and face2
   shared_ptr<Interest> interest1 = makeInterest("ndn:/seRMz5a6/%00");
-  interest1->setInterestLifetime(time::milliseconds(2000));
+  interest1->setInterestLifetime(2_s);
   shared_ptr<pit::Entry> pitEntry1 = pit.insert(*interest1).first;
 
   pitEntry1->insertOrUpdateInRecord(*face3, 0, *interest1);
   strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), *interest1, pitEntry1);
-  limitedIo.run(2 - strategy.sendInterestHistory.size(),
-                time::milliseconds(2000), time::milliseconds(10));
+  limitedIo.run(2 - strategy.sendInterestHistory.size(), 2_s, 10_ms);
   BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 2);
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory[0].outFaceId, face1->getId());
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory[1].outFaceId, face2->getId());
@@ -193,20 +190,19 @@
   shared_ptr<Data> data1 = makeData("ndn:/seRMz5a6/%00");
   strategy.beforeSatisfyInterest(pitEntry1, FaceEndpoint(*face1, 0), *data1);
   pitEntry1->clearInRecords();
-  this->advanceClocks(time::milliseconds(10));
+  this->advanceClocks(10_ms);
   // face2 also responds
   strategy.beforeSatisfyInterest(pitEntry1, FaceEndpoint(*face2, 0), *data1);
-  this->advanceClocks(time::milliseconds(10));
+  this->advanceClocks(10_ms);
 
   // second Interest: bestFace should be face 1
   shared_ptr<Interest> interest2 = makeInterest("ndn:/seRMz5a6/%01");
-  interest2->setInterestLifetime(time::milliseconds(2000));
+  interest2->setInterestLifetime(2_s);
   shared_ptr<pit::Entry> pitEntry2 = pit.insert(*interest2).first;
 
   pitEntry2->insertOrUpdateInRecord(*face3, 0, *interest2);
   strategy.afterReceiveInterest(FaceEndpoint(*face3, 0), *interest2, pitEntry2);
-  limitedIo.run(3 - strategy.sendInterestHistory.size(),
-                time::milliseconds(2000), time::milliseconds(10));
+  limitedIo.run(3 - strategy.sendInterestHistory.size(), 2_s, 10_ms);
 
   BOOST_REQUIRE_GE(strategy.sendInterestHistory.size(), 3);
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory[2].outFaceId, face1->getId());
@@ -232,29 +228,27 @@
 
   // first Interest: strategy forwards to face2
   shared_ptr<Interest> interest1 = makeInterest("ndn:/M4mBXCsd");
-  interest1->setInterestLifetime(time::milliseconds(2000));
+  interest1->setInterestLifetime(2_s);
   shared_ptr<pit::Entry> pitEntry1 = pit.insert(*interest1).first;
 
   pitEntry1->insertOrUpdateInRecord(*face1, 0, *interest1);
   strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest1, pitEntry1);
-  limitedIo.run(1 - strategy.sendInterestHistory.size(),
-                time::milliseconds(2000), time::milliseconds(10));
+  limitedIo.run(1 - strategy.sendInterestHistory.size(), 2_s, 10_ms);
   BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 1);
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory[0].outFaceId, face2->getId());
 
   // face2 responds
   shared_ptr<Data> data1 = makeData("ndn:/M4mBXCsd");
-  data1->setFreshnessPeriod(time::milliseconds(5));
+  data1->setFreshnessPeriod(5_ms);
   strategy.beforeSatisfyInterest(pitEntry1, FaceEndpoint(*face2, 0), *data1);
   pitEntry1->deleteOutRecord(*face2, 0);
   pitEntry1->clearInRecords();
-  this->advanceClocks(time::milliseconds(10));
+  this->advanceClocks(10_ms);
 
   // similar Interest: strategy should still forward it
   pitEntry1->insertOrUpdateInRecord(*face1, 0, *interest1);
   strategy.afterReceiveInterest(FaceEndpoint(*face1, 0), *interest1, pitEntry1);
-  limitedIo.run(2 - strategy.sendInterestHistory.size(),
-                time::milliseconds(2000), time::milliseconds(10));
+  limitedIo.run(2 - strategy.sendInterestHistory.size(), 2_s, 10_ms);
   BOOST_REQUIRE_EQUAL(strategy.sendInterestHistory.size(), 2);
   BOOST_CHECK_EQUAL(strategy.sendInterestHistory[1].outFaceId, face2->getId());
 }
@@ -323,10 +317,10 @@
     topo.setStrategy<NccStrategy>(node);
   }
 
-  shared_ptr<TopologyLink> linkAB = topo.addLink("AB", time::milliseconds( 5), {nodeA, nodeB}),
-                           linkAC = topo.addLink("AC", time::milliseconds( 5), {nodeA, nodeC}),
-                           linkBD = topo.addLink("BD", time::milliseconds(15), {nodeB, nodeD}),
-                           linkCD = topo.addLink("CD", time::milliseconds(15), {nodeC, nodeD});
+  shared_ptr<TopologyLink> linkAB = topo.addLink("AB", 5_ms, {nodeA, nodeB}),
+                           linkAC = topo.addLink("AC", 5_ms, {nodeA, nodeC}),
+                           linkBD = topo.addLink("BD", 15_ms, {nodeB, nodeD}),
+                           linkCD = topo.addLink("CD", 15_ms, {nodeC, nodeD});
 
   topo.registerPrefix(nodeA, linkAB->getFace(nodeA), "ndn:/P");
   topo.registerPrefix(nodeA, linkAC->getFace(nodeA), "ndn:/P");
@@ -338,7 +332,7 @@
 
   shared_ptr<TopologyAppLink> consumer = topo.addAppFace("consumer", nodeA);
   topo.addIntervalConsumer(consumer->getClientFace(), "ndn:/P",
-                           time::milliseconds(100), 300);
+                           100_ms, 300);
 
   auto getMeInfo = [&] () -> NccStrategy::MeasurementsEntryInfo* {
     Measurements& measurements = topo.getForwarder(nodeA).getMeasurements();
@@ -353,7 +347,7 @@
   bool isLastPredictionUnder = true;
   int nPredictionCrossings = 0;
   for (int i = 0; i < 10000; ++i) {
-    this->advanceClocks(time::milliseconds(5));
+    this->advanceClocks(5_ms);
     auto meInfo = getMeInfo();
     if (meInfo == nullptr) {
       continue;
@@ -369,7 +363,7 @@
       }
     }
   }
-  BOOST_REQUIRE_MESSAGE(isExplorationFinished, "exploration does not finish in 50000ms");
+  BOOST_REQUIRE_MESSAGE(isExplorationFinished, "exploration did not finish within 50s");
 
   // NccStrategy has selected one path as the best.
   // When we reduce the RTT of the other path, ideally it should be selected as the best face.
@@ -377,10 +371,10 @@
   // See https://redmine.named-data.net/issues/3411#note-4
   shared_ptr<Face> bestFace1 = getMeInfo()->bestFace.lock();
   if (bestFace1.get() == &linkAB->getFace(nodeA)) {
-    linkCD->setDelay(time::milliseconds(5));
+    linkCD->setDelay(5_ms);
   }
   else if (bestFace1.get() == &linkAC->getFace(nodeA)) {
-    linkBD->setDelay(time::milliseconds(5));
+    linkBD->setDelay(5_ms);
   }
   else {
     BOOST_FAIL("unexpected best face");
@@ -388,7 +382,7 @@
 
   bool isNewBestChosen = false;
   for (int i = 0; i < 10000; ++i) {
-    this->advanceClocks(time::milliseconds(5));
+    this->advanceClocks(5_ms);
     auto meInfo = getMeInfo();
     if (meInfo == nullptr) {
       continue;
diff --git a/tests/daemon/fw/retx-suppression.t.cpp b/tests/daemon/fw/retx-suppression.t.cpp
index a0aab02..de4c206 100644
--- a/tests/daemon/fw/retx-suppression.t.cpp
+++ b/tests/daemon/fw/retx-suppression.t.cpp
@@ -93,7 +93,7 @@
 {
   Forwarder forwarder;
   Pit& pit = forwarder.getPit();
-  RetxSuppressionExponential rs(time::milliseconds(10), 3.0, time::milliseconds(100));
+  RetxSuppressionExponential rs(10_ms, 3.0, 100_ms);
 
   shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
   shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
@@ -109,12 +109,12 @@
   pitEntry->insertOrUpdateOutRecord(*face2, 0, *interest);
   // suppression interval is 10ms, until 10ms
 
-  this->advanceClocks(time::milliseconds(5)); // @ 5ms
+  this->advanceClocks(5_ms); // @ 5ms
   pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
   BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::SUPPRESS);
   // suppression interval is 10ms, until 10ms
 
-  this->advanceClocks(time::milliseconds(6)); // @ 11ms
+  this->advanceClocks(6_ms); // @ 11ms
   // note: what happens at *exactly* 10ms does not matter so it's untested,
   // because in reality network timing won't be exact:
   // incoming Interest is processed either before or after 10ms point
@@ -123,34 +123,34 @@
   pitEntry->insertOrUpdateOutRecord(*face2, 0, *interest);
   // suppression interval is 30ms, until 41ms
 
-  this->advanceClocks(time::milliseconds(25)); // @ 36ms
+  this->advanceClocks(25_ms); // @ 36ms
   pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
   BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::SUPPRESS);
   // suppression interval is 30ms, until 41ms
 
-  this->advanceClocks(time::milliseconds(6)); // @ 42ms
+  this->advanceClocks(6_ms); // @ 42ms
   pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
   BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::FORWARD);
   // strategy decides not to forward, but suppression interval is increased nevertheless
   // suppression interval is 90ms, until 101ms
 
-  this->advanceClocks(time::milliseconds(58)); // @ 100ms
+  this->advanceClocks(58_ms); // @ 100ms
   pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
   BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::SUPPRESS);
   // suppression interval is 90ms, until 101ms
 
-  this->advanceClocks(time::milliseconds(3)); // @ 103ms
+  this->advanceClocks(3_ms); // @ 103ms
   pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
   BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::FORWARD);
   pitEntry->insertOrUpdateOutRecord(*face2, 0, *interest);
   // suppression interval is 100ms, until 203ms
 
-  this->advanceClocks(time::milliseconds(99)); // @ 202ms
+  this->advanceClocks(99_ms); // @ 202ms
   pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
   BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::SUPPRESS);
   // suppression interval is 100ms, until 203ms
 
-  this->advanceClocks(time::milliseconds(2)); // @ 204ms
+  this->advanceClocks(2_ms); // @ 204ms
   pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
   BOOST_CHECK(rs.decidePerPitEntry(*pitEntry) == RetxSuppressionResult::FORWARD);
   pitEntry->insertOrUpdateOutRecord(*face2, 0, *interest);
@@ -161,7 +161,7 @@
 {
   Forwarder forwarder;
   Pit& pit = forwarder.getPit();
-  RetxSuppressionExponential rs(time::milliseconds(10), 3.0, time::milliseconds(100));
+  RetxSuppressionExponential rs(10_ms, 3.0, 100_ms);
 
   shared_ptr<DummyFace> face1 = make_shared<DummyFace>();
   shared_ptr<DummyFace> face2 = make_shared<DummyFace>();
@@ -177,7 +177,7 @@
 
   // Simluate forwarding an interest to face2
   pitEntry->insertOrUpdateOutRecord(*face2, 0, *interest);
-  this->advanceClocks(time::milliseconds(5)); // @ 5ms
+  this->advanceClocks(5_ms); // @ 5ms
 
   pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
   BOOST_CHECK(rs.decidePerUpstream(*pitEntry, *face2) == RetxSuppressionResult::SUPPRESS);
@@ -186,7 +186,7 @@
   pitEntry->insertOrUpdateInRecord(*face2, 0, *interest);
   BOOST_CHECK(rs.decidePerUpstream(*pitEntry, *face1) == RetxSuppressionResult::NEW);
 
-  this->advanceClocks(time::milliseconds(6)); // @ 11ms
+  this->advanceClocks(6_ms); // @ 11ms
 
   pitEntry->insertOrUpdateInRecord(*face1, 0, *interest);
   BOOST_CHECK(rs.decidePerUpstream(*pitEntry, *face2) == RetxSuppressionResult::FORWARD);
diff --git a/tests/daemon/fw/strategy-nack-return.t.cpp b/tests/daemon/fw/strategy-nack-return.t.cpp
index 2708710..c9a66c2 100644
--- a/tests/daemon/fw/strategy-nack-return.t.cpp
+++ b/tests/daemon/fw/strategy-nack-return.t.cpp
@@ -42,8 +42,6 @@
 namespace fw {
 namespace tests {
 
-using namespace nfd::tests;
-
 BOOST_AUTO_TEST_SUITE(Fw)
 
 template<typename S>
@@ -168,17 +166,17 @@
   fibEntry.addOrUpdateNextHop(*this->face5, 0, 30);
 
   shared_ptr<Interest> interest1 = makeInterest("/sIYw0TXWDj", 115);
-  interest1->setInterestLifetime(time::milliseconds(400));
+  interest1->setInterestLifetime(400_ms);
   shared_ptr<pit::Entry> pitEntry = this->pit.insert(*interest1).first;
   pitEntry->insertOrUpdateInRecord(*this->face1, 0, *interest1);
   pitEntry->insertOrUpdateOutRecord(*this->face3, 0, *interest1);
 
-  this->advanceClocks(time::milliseconds(300));
+  this->advanceClocks(300_ms);
   shared_ptr<Interest> interest2 = makeInterest("/sIYw0TXWDj", 223);
   pitEntry->insertOrUpdateInRecord(*this->face1, 0, *interest2);
   pitEntry->insertOrUpdateOutRecord(*this->face4, 0, *interest2);
 
-  this->advanceClocks(time::milliseconds(200)); // face3 has timed out
+  this->advanceClocks(200_ms); // face3 has timed out
 
   lp::Nack nack4 = makeNack("/sIYw0TXWDj", 223, lp::NackReason::CONGESTION);
   pitEntry->getOutRecord(*this->face4, 0)->setIncomingNack(nack4);
@@ -257,12 +255,12 @@
   ndn::Face& appD = topo.addAppFace("D", nodeD)->getClientFace();
 
   int nNacksA = 0, nNacksD = 0;
-  appA.expressInterest(Interest("/P/1"), nullptr, bind([&nNacksA]{ ++nNacksA; }), nullptr);
-  appD.expressInterest(Interest("/P/1"), nullptr, bind([&nNacksD]{ ++nNacksD; }), nullptr);
-  this->advanceClocks(time::milliseconds(1), time::milliseconds(5));
-  appA.expressInterest(Interest("/P/1"), nullptr, bind([&nNacksA]{ ++nNacksA; }), nullptr);
-  appD.expressInterest(Interest("/P/1"), nullptr, bind([&nNacksD]{ ++nNacksD; }), nullptr);
-  this->advanceClocks(time::milliseconds(1), time::milliseconds(100));
+  appA.expressInterest(Interest("/P/1"), nullptr, bind([&nNacksA] { ++nNacksA; }), nullptr);
+  appD.expressInterest(Interest("/P/1"), nullptr, bind([&nNacksD] { ++nNacksD; }), nullptr);
+  this->advanceClocks(1_ms, 5_ms);
+  appA.expressInterest(Interest("/P/1"), nullptr, bind([&nNacksA] { ++nNacksA; }), nullptr);
+  appD.expressInterest(Interest("/P/1"), nullptr, bind([&nNacksD] { ++nNacksD; }), nullptr);
+  this->advanceClocks(1_ms, 100_ms);
 
   // As long as at least one Nack arrives at each client, strategy behavior is correct.
   // Whether both Interests are Nacked is a client face behavior, not strategy behavior.
diff --git a/tests/daemon/fw/strategy-no-route.t.cpp b/tests/daemon/fw/strategy-no-route.t.cpp
index daf3f2a..43c57d0 100644
--- a/tests/daemon/fw/strategy-no-route.t.cpp
+++ b/tests/daemon/fw/strategy-no-route.t.cpp
@@ -46,8 +46,6 @@
 namespace fw {
 namespace tests {
 
-using namespace nfd::tests;
-
 template<typename S>
 class StrategyNoRouteFixture : public GlobalIoTimeFixture
 {
diff --git a/tests/daemon/fw/strategy-scope-control.t.cpp b/tests/daemon/fw/strategy-scope-control.t.cpp
index 2980834..4b83e46 100644
--- a/tests/daemon/fw/strategy-scope-control.t.cpp
+++ b/tests/daemon/fw/strategy-scope-control.t.cpp
@@ -47,8 +47,6 @@
 namespace fw {
 namespace tests {
 
-using namespace nfd::tests;
-
 template<typename S>
 class StrategyScopeControlFixture : public GlobalIoTimeFixture
 {
diff --git a/tests/daemon/fw/strategy-tester.hpp b/tests/daemon/fw/strategy-tester.hpp
index f2ac93d..3ddf8f6 100644
--- a/tests/daemon/fw/strategy-tester.hpp
+++ b/tests/daemon/fw/strategy-tester.hpp
@@ -34,14 +34,16 @@
 namespace fw {
 namespace tests {
 
-/** \brief extends strategy S for unit testing
+using namespace nfd::tests;
+
+/** \brief Extends strategy S for unit testing.
  *
- *  Actions invoked by S are recorded but not passed to forwarder
+ *  Actions invoked by S are recorded but not passed to forwarder.
  *
  *  StrategyTester should be registered into the strategy registry prior to use.
  *  \code
  *  // appears in or included by every .cpp MyStrategyTester is used
- *  typedef StrategyTester<MyStrategy> MyStrategyTester;
+ *  using MyStrategyTester = StrategyTester<MyStrategy>;
  *
  *  // appears in only one .cpp
  *  NFD_REGISTER_STRATEGY(MyStrategyTester);
@@ -82,9 +84,9 @@
    *  \note The actions may occur either during f() invocation or afterwards.
    *  \return whether expected number of actions have occurred
    */
+  template<typename F>
   bool
-  waitForAction(const std::function<void()>& f,
-                nfd::tests::LimitedIo& limitedIo, int nExpectedActions = 1)
+  waitForAction(F&& f, LimitedIo& limitedIo, int nExpectedActions = 1)
   {
     int nActions = 0;
 
@@ -99,8 +101,7 @@
       // A correctly implemented strategy is required to invoke reject pending Interest action if it
       // decides to not forward an Interest. If a test case is stuck in the call below, check that
       // rejectPendingInterest is invoked under proper condition.
-      return limitedIo.run(nExpectedActions - nActions, nfd::tests::LimitedIo::UNLIMITED_TIME) ==
-             nfd::tests::LimitedIo::EXCEED_OPS;
+      return limitedIo.run(nExpectedActions - nActions, LimitedIo::UNLIMITED_TIME) == LimitedIo::EXCEED_OPS;
     }
     return nActions == nExpectedActions;
   }
diff --git a/tests/daemon/mgmt/fib-manager.t.cpp b/tests/daemon/mgmt/fib-manager.t.cpp
index 1002e44..5d61168 100644
--- a/tests/daemon/mgmt/fib-manager.t.cpp
+++ b/tests/daemon/mgmt/fib-manager.t.cpp
@@ -65,7 +65,7 @@
   {
     auto face = make_shared<DummyFace>();
     m_faceTable.add(face);
-    advanceClocks(time::milliseconds(1), 10);
+    advanceClocks(1_ms, 10);
     m_responses.clear(); // clear all event notifications, if any
     return face->getId();
   }
diff --git a/tests/daemon/mgmt/forwarder-status-manager.t.cpp b/tests/daemon/mgmt/forwarder-status-manager.t.cpp
index bb728f2..e40e20d 100644
--- a/tests/daemon/mgmt/forwarder-status-manager.t.cpp
+++ b/tests/daemon/mgmt/forwarder-status-manager.t.cpp
@@ -53,7 +53,7 @@
 BOOST_AUTO_TEST_CASE(GeneralStatusDataset)
 {
   // cause counters to be non-zero
-  this->advanceClocks(time::seconds(3600));
+  this->advanceClocks(1_h);
   m_forwarder.getFib().insert("ndn:/fib1");
   m_forwarder.getPit().insert(*makeInterest("ndn:/pit1"));
   m_forwarder.getPit().insert(*makeInterest("ndn:/pit2"));
diff --git a/tests/daemon/mgmt/manager-base.t.cpp b/tests/daemon/mgmt/manager-base.t.cpp
index 3aeeb9e..0dace4e 100644
--- a/tests/daemon/mgmt/manager-base.t.cpp
+++ b/tests/daemon/mgmt/manager-base.t.cpp
@@ -125,7 +125,7 @@
 
   const uint8_t buf[] = {0x82, 0x01, 0x02};
   post(Block(buf, sizeof(buf)));
-  advanceClocks(time::milliseconds(1));
+  advanceClocks(1_ms);
 
   BOOST_REQUIRE_EQUAL(m_responses.size(), 1);
   BOOST_CHECK_EQUAL(m_responses[0].getName(),
diff --git a/tests/daemon/rib/fib-updates-common.hpp b/tests/daemon/rib/fib-updates-common.hpp
index 77348be..9afd4a5 100644
--- a/tests/daemon/rib/fib-updates-common.hpp
+++ b/tests/daemon/rib/fib-updates-common.hpp
@@ -38,30 +38,9 @@
 namespace rib {
 namespace tests {
 
-inline bool
-compareNameFaceIdCostAction(const FibUpdate& lhs, const FibUpdate& rhs)
-{
-  if (lhs.name < rhs.name) {
-    return true;
-  }
-  else if (lhs.name == rhs.name) {
-    if (lhs.faceId < rhs.faceId) {
-      return true;
-    }
-    else if (lhs.faceId == rhs.faceId) {
-      if (lhs.cost < rhs.cost) {
-        return true;
-      }
-      else if (lhs.cost == rhs.cost) {
-        return lhs.action < rhs.action;
-      }
-    }
-  }
+using namespace nfd::tests;
 
-  return false;
-}
-
-class FibUpdatesFixture : public nfd::tests::GlobalIoFixture, public nfd::tests::KeyChainFixture
+class FibUpdatesFixture : public GlobalIoFixture, public KeyChainFixture
 {
 public:
   FibUpdatesFixture()
@@ -125,7 +104,10 @@
   getSortedFibUpdates()
   {
     FibUpdater::FibUpdateList updates = getFibUpdates();
-    updates.sort(&compareNameFaceIdCostAction);
+    updates.sort([] (const auto& lhs, const auto& rhs) {
+      return std::tie(lhs.name, lhs.faceId, lhs.cost, lhs.action) <
+             std::tie(rhs.name, rhs.faceId, rhs.cost, rhs.action);
+    });
     return updates;
   }
 
diff --git a/tests/daemon/rib/readvertise/host-to-gateway-readvertise-policy.t.cpp b/tests/daemon/rib/readvertise/host-to-gateway-readvertise-policy.t.cpp
index 94120c0..494eac2 100644
--- a/tests/daemon/rib/readvertise/host-to-gateway-readvertise-policy.t.cpp
+++ b/tests/daemon/rib/readvertise/host-to-gateway-readvertise-policy.t.cpp
@@ -96,16 +96,16 @@
 BOOST_AUTO_TEST_CASE(LoadRefreshInterval)
 {
   auto policy = makePolicy();
-  BOOST_CHECK_EQUAL(policy->getRefreshInterval(), time::seconds(25)); // default setting is 25
+  BOOST_CHECK_EQUAL(policy->getRefreshInterval(), 25_s); // default setting is 25
 
   ConfigSection section;
   section.put("refresh_interval_wrong", 10);
   policy = makePolicy(section);
-  BOOST_CHECK_EQUAL(policy->getRefreshInterval(), time::seconds(25)); // wrong formate
+  BOOST_CHECK_EQUAL(policy->getRefreshInterval(), 25_s); // wrong formate
 
   section.put("refresh_interval", 10);
   policy = makePolicy(section);
-  BOOST_CHECK_EQUAL(policy->getRefreshInterval(), time::seconds(10));
+  BOOST_CHECK_EQUAL(policy->getRefreshInterval(), 10_s);
 }
 
 BOOST_AUTO_TEST_SUITE_END() // TestHostToGatewayReadvertisePolicy
diff --git a/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp b/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp
index 690a53b..5a64bbe 100644
--- a/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp
+++ b/tests/daemon/rib/readvertise/nfd-rib-readvertise-destination.t.cpp
@@ -125,7 +125,7 @@
   const Name RIB_REGISTER_COMMAND_PREFIX("/localhost/nlsr/rib/register");
 
   dest.advertise(rr, successCallback, failureCallback);
-  advanceClocks(time::milliseconds(100));
+  advanceClocks(100_ms);
 
   // Retrieve the sent Interest to build the response
   BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
@@ -142,7 +142,7 @@
   auto responseData = makeData(sentInterest.getName());
   responseData->setContent(responsePayload.wireEncode());
   face.receive(*responseData);
-  this->advanceClocks(time::milliseconds(10));
+  this->advanceClocks(10_ms);
 
   scenario.checkCommandOutcome(this);
 }
@@ -203,7 +203,7 @@
   const Name RIB_UNREGISTER_COMMAND_PREFIX("/localhost/nlsr/rib/unregister");
 
   dest.withdraw(rr, successCallback, failureCallback);
-  this->advanceClocks(time::milliseconds(10));
+  this->advanceClocks(10_ms);
 
   // Retrieve the sent Interest to build the response
   BOOST_REQUIRE_EQUAL(face.sentInterests.size(), 1);
@@ -220,7 +220,7 @@
   responseData->setContent(responsePayload.wireEncode());
 
   face.receive(*responseData);
-  this->advanceClocks(time::milliseconds(1));
+  this->advanceClocks(1_ms);
 
   scenario.checkCommandOutcome(this);
 }
@@ -236,13 +236,13 @@
   BOOST_CHECK_EQUAL(dest.isAvailable(), false);
 
   rib.insert(commandPrefix, route);
-  this->advanceClocks(time::milliseconds(100));
+  this->advanceClocks(100_ms);
   BOOST_CHECK_EQUAL(dest.isAvailable(), true);
   BOOST_REQUIRE_EQUAL(availabilityChangeHistory.size(), 1);
   BOOST_CHECK_EQUAL(availabilityChangeHistory.back(), true);
 
   rib.erase(commandPrefix, route);
-  this->advanceClocks(time::milliseconds(100));
+  this->advanceClocks(100_ms);
   BOOST_CHECK_EQUAL(dest.isAvailable(), false);
   BOOST_REQUIRE_EQUAL(availabilityChangeHistory.size(), 2);
   BOOST_CHECK_EQUAL(availabilityChangeHistory.back(), false);
diff --git a/tests/daemon/rib/readvertise/readvertise.t.cpp b/tests/daemon/rib/readvertise/readvertise.t.cpp
index 090bd5a..1988a20 100644
--- a/tests/daemon/rib/readvertise/readvertise.t.cpp
+++ b/tests/daemon/rib/readvertise/readvertise.t.cpp
@@ -133,7 +133,7 @@
     route.faceId = faceId;
     route.origin = origin;
     m_rib.insert(prefix, route);
-    this->advanceClocks(time::milliseconds(6));
+    this->advanceClocks(6_ms);
   }
 
   void
@@ -143,14 +143,14 @@
     route.faceId = faceId;
     route.origin = origin;
     m_rib.erase(prefix, route);
-    this->advanceClocks(time::milliseconds(6));
+    this->advanceClocks(6_ms);
   }
 
   void
   setDestinationAvailability(bool isAvailable)
   {
     destination->setAvailability(isAvailable);
-    this->advanceClocks(time::milliseconds(6));
+    this->advanceClocks(6_ms);
   }
 
 protected:
@@ -181,7 +181,7 @@
 
   // refresh every 60 seconds
   destination->advertiseHistory.clear();
-  this->advanceClocks(time::seconds(61), 5);
+  this->advanceClocks(61_s, 5);
   BOOST_CHECK_EQUAL(destination->advertiseHistory.size(), 5);
 
   // /A is still needed by /A/2 route
@@ -244,7 +244,7 @@
   policy->decision = ReadvertiseAction{"/A", ndn::security::SigningInfo()};
   this->insertRoute("/A/1", 1, ndn::nfd::ROUTE_ORIGIN_CLIENT);
 
-  this->advanceClocks(time::seconds(10), time::seconds(3600));
+  this->advanceClocks(10_s, 1_h);
   BOOST_REQUIRE_GT(destination->advertiseHistory.size(), 2);
 
   // destination->advertise keeps failing, so interval should increase
@@ -260,12 +260,12 @@
   }
 
   destination->shouldSucceed = true;
-  this->advanceClocks(time::seconds(3600));
+  this->advanceClocks(1_h);
   destination->advertiseHistory.clear();
 
   // destination->advertise has succeeded, retry interval should reset to initial
   destination->shouldSucceed = false;
-  this->advanceClocks(time::seconds(10), time::seconds(300));
+  this->advanceClocks(10_s, 300_s);
   BOOST_REQUIRE_GE(destination->advertiseHistory.size(), 2);
   FloatInterval restartInterval = destination->advertiseHistory[1].timestamp -
                                   destination->advertiseHistory[0].timestamp;
@@ -277,7 +277,7 @@
   destination->shouldSucceed = false;
   policy->decision = ReadvertiseAction{"/A", ndn::security::SigningInfo()};
   this->insertRoute("/A/1", 1, ndn::nfd::ROUTE_ORIGIN_CLIENT);
-  this->advanceClocks(time::seconds(10), time::seconds(300));
+  this->advanceClocks(10_s, 300_s);
   BOOST_CHECK_GT(destination->advertiseHistory.size(), 0);
   BOOST_CHECK_EQUAL(destination->withdrawHistory.size(), 0);
 
@@ -285,7 +285,7 @@
   destination->advertiseHistory.clear();
   destination->withdrawHistory.clear();
   this->eraseRoute("/A/1", 1, ndn::nfd::ROUTE_ORIGIN_CLIENT);
-  this->advanceClocks(time::seconds(10), time::seconds(300));
+  this->advanceClocks(10_s, 300_s);
   BOOST_CHECK_EQUAL(destination->advertiseHistory.size(), 0); // don't try to advertise
   BOOST_CHECK_GT(destination->withdrawHistory.size(), 0); // try to withdraw
 
@@ -293,7 +293,7 @@
   destination->advertiseHistory.clear();
   destination->withdrawHistory.clear();
   this->insertRoute("/A/1", 1, ndn::nfd::ROUTE_ORIGIN_CLIENT);
-  this->advanceClocks(time::seconds(10), time::seconds(300));
+  this->advanceClocks(10_s, 300_s);
   BOOST_CHECK_GT(destination->advertiseHistory.size(), 0); // try to advertise
   BOOST_CHECK_EQUAL(destination->withdrawHistory.size(), 0); // don't try to withdraw
 }
diff --git a/tests/daemon/rib/rib-update.t.cpp b/tests/daemon/rib/rib-update.t.cpp
index a4feca1..81ee10e 100644
--- a/tests/daemon/rib/rib-update.t.cpp
+++ b/tests/daemon/rib/rib-update.t.cpp
@@ -34,7 +34,9 @@
 namespace rib {
 namespace tests {
 
-BOOST_FIXTURE_TEST_SUITE(TestRibUpdate, nfd::tests::GlobalIoFixture)
+using namespace nfd::tests;
+
+BOOST_FIXTURE_TEST_SUITE(TestRibUpdate, GlobalIoFixture)
 
 BOOST_AUTO_TEST_CASE(BatchBasic)
 {
diff --git a/tests/daemon/rib/rib.t.cpp b/tests/daemon/rib/rib.t.cpp
index a1b8363..7de4ebe 100644
--- a/tests/daemon/rib/rib.t.cpp
+++ b/tests/daemon/rib/rib.t.cpp
@@ -33,7 +33,9 @@
 namespace rib {
 namespace tests {
 
-BOOST_FIXTURE_TEST_SUITE(TestRib, nfd::tests::GlobalIoFixture)
+using namespace nfd::tests;
+
+BOOST_FIXTURE_TEST_SUITE(TestRib, GlobalIoFixture)
 
 BOOST_AUTO_TEST_CASE(Parent)
 {
@@ -170,7 +172,7 @@
   route1.faceId = 1;
   route1.cost = 10;
   route1.flags = ndn::nfd::ROUTE_FLAG_CHILD_INHERIT | ndn::nfd::ROUTE_FLAG_CAPTURE;
-  route1.expires = time::steady_clock::now() + time::milliseconds(1500);
+  route1.expires = time::steady_clock::now() + 1500_ms;
 
   rib.insert(name1, route1);
   BOOST_CHECK_EQUAL(rib.size(), 1);
@@ -183,7 +185,7 @@
   route2.faceId = 1;
   route2.cost = 100;
   route2.flags = ndn::nfd::ROUTE_FLAG_CHILD_INHERIT;
-  route2.expires = time::steady_clock::now() + time::seconds(0);
+  route2.expires = time::steady_clock::now() + 0_s;
 
   rib.insert(name2, route2);
   BOOST_CHECK_EQUAL(rib.size(), 1);
diff --git a/tests/daemon/rib/service.t.cpp b/tests/daemon/rib/service.t.cpp
index 156257b..e732e07 100644
--- a/tests/daemon/rib/service.t.cpp
+++ b/tests/daemon/rib/service.t.cpp
@@ -33,7 +33,9 @@
 namespace rib {
 namespace tests {
 
-BOOST_FIXTURE_TEST_SUITE(TestService, nfd::tests::RibIoFixture)
+using namespace nfd::tests;
+
+BOOST_FIXTURE_TEST_SUITE(TestService, RibIoFixture)
 
 BOOST_AUTO_TEST_CASE(Basic)
 {
diff --git a/tests/daemon/table/cs-policy-priority-fifo.t.cpp b/tests/daemon/table/cs-policy-priority-fifo.t.cpp
index cd71b5b..37fcbc7 100644
--- a/tests/daemon/table/cs-policy-priority-fifo.t.cpp
+++ b/tests/daemon/table/cs-policy-priority-fifo.t.cpp
@@ -50,25 +50,25 @@
   cs.setPolicy(make_unique<PriorityFifoPolicy>());
 
   shared_ptr<Data> dataA = makeData("ndn:/A");
-  dataA->setFreshnessPeriod(time::milliseconds(99999));
+  dataA->setFreshnessPeriod(99999_ms);
   dataA->wireEncode();
   cs.insert(*dataA);
 
   shared_ptr<Data> dataB = makeData("ndn:/B");
-  dataB->setFreshnessPeriod(time::milliseconds(10));
+  dataB->setFreshnessPeriod(10_ms);
   dataB->wireEncode();
   cs.insert(*dataB);
 
   shared_ptr<Data> dataC = makeData("ndn:/C");
-  dataC->setFreshnessPeriod(time::milliseconds(99999));
+  dataC->setFreshnessPeriod(99999_ms);
   dataC->wireEncode();
   cs.insert(*dataC, true);
 
-  this->advanceClocks(time::milliseconds(11));
+  this->advanceClocks(11_ms);
 
   // evict unsolicited
   shared_ptr<Data> dataD = makeData("ndn:/D");
-  dataD->setFreshnessPeriod(time::milliseconds(99999));
+  dataD->setFreshnessPeriod(99999_ms);
   dataD->wireEncode();
   cs.insert(*dataD);
   BOOST_CHECK_EQUAL(cs.size(), 3);
@@ -78,7 +78,7 @@
 
   // evict stale
   shared_ptr<Data> dataE = makeData("ndn:/E");
-  dataE->setFreshnessPeriod(time::milliseconds(99999));
+  dataE->setFreshnessPeriod(99999_ms);
   dataE->wireEncode();
   cs.insert(*dataE);
   BOOST_CHECK_EQUAL(cs.size(), 3);
@@ -88,7 +88,7 @@
 
   // evict fifo
   shared_ptr<Data> dataF = makeData("ndn:/F");
-  dataF->setFreshnessPeriod(time::milliseconds(99999));
+  dataF->setFreshnessPeriod(99999_ms);
   dataF->wireEncode();
   cs.insert(*dataF);
   BOOST_CHECK_EQUAL(cs.size(), 3);
@@ -103,21 +103,21 @@
   cs.setPolicy(make_unique<PriorityFifoPolicy>());
 
   shared_ptr<Data> dataA = makeData("ndn:/A");
-  dataA->setFreshnessPeriod(time::milliseconds(99999));
+  dataA->setFreshnessPeriod(99999_ms);
   dataA->wireEncode();
   cs.insert(*dataA);
 
   shared_ptr<Data> dataB = makeData("ndn:/B");
-  dataB->setFreshnessPeriod(time::milliseconds(10));
+  dataB->setFreshnessPeriod(10_ms);
   dataB->wireEncode();
   cs.insert(*dataB);
 
   shared_ptr<Data> dataC = makeData("ndn:/C");
-  dataC->setFreshnessPeriod(time::milliseconds(10));
+  dataC->setFreshnessPeriod(10_ms);
   dataC->wireEncode();
   cs.insert(*dataC);
 
-  this->advanceClocks(time::milliseconds(11));
+  this->advanceClocks(11_ms);
 
   // refresh dataB
   shared_ptr<Data> dataB2 = make_shared<Data>(*dataB);
@@ -138,7 +138,7 @@
 
   // evict dataC stale
   shared_ptr<Data> dataD = makeData("ndn:/D");
-  dataD->setFreshnessPeriod(time::milliseconds(99999));
+  dataD->setFreshnessPeriod(99999_ms);
   dataD->wireEncode();
   cs.insert(*dataD);
   BOOST_CHECK_EQUAL(cs.size(), 3);
diff --git a/tests/daemon/table/cs.t.cpp b/tests/daemon/table/cs.t.cpp
index bcfd3a5..db980d2 100644
--- a/tests/daemon/table/cs.t.cpp
+++ b/tests/daemon/table/cs.t.cpp
@@ -272,28 +272,28 @@
 BOOST_AUTO_TEST_CASE(MustBeFresh)
 {
   insert(1, "/A/1"); // omitted FreshnessPeriod means FreshnessPeriod = 0 ms
-  insert(2, "/A/2", [] (Data& data) { data.setFreshnessPeriod(time::seconds(0)); });
-  insert(3, "/A/3", [] (Data& data) { data.setFreshnessPeriod(time::seconds(1)); });
-  insert(4, "/A/4", [] (Data& data) { data.setFreshnessPeriod(time::seconds(3600)); });
+  insert(2, "/A/2", [] (Data& data) { data.setFreshnessPeriod(0_s); });
+  insert(3, "/A/3", [] (Data& data) { data.setFreshnessPeriod(1_s); });
+  insert(4, "/A/4", [] (Data& data) { data.setFreshnessPeriod(1_h); });
 
   // lookup at exact same moment as insertion is not tested because this won't happen in reality
 
-  this->advanceClocks(time::milliseconds(500)); // @500ms
+  this->advanceClocks(500_ms); // @500ms
   startInterest("/A")
     .setMustBeFresh(true);
   CHECK_CS_FIND(3);
 
-  this->advanceClocks(time::milliseconds(1500)); // @2s
+  this->advanceClocks(1500_ms); // @2s
   startInterest("/A")
     .setMustBeFresh(true);
   CHECK_CS_FIND(4);
 
-  this->advanceClocks(time::seconds(3500)); // @3502s
+  this->advanceClocks(3500_s); // @3502s
   startInterest("/A")
     .setMustBeFresh(true);
   CHECK_CS_FIND(4);
 
-  this->advanceClocks(time::seconds(3500)); // @7002s
+  this->advanceClocks(3500_s); // @7002s
   startInterest("/A")
     .setMustBeFresh(true);
   CHECK_CS_FIND(0);
diff --git a/tests/daemon/table/dead-nonce-list.t.cpp b/tests/daemon/table/dead-nonce-list.t.cpp
index ea7866c..1cd32eb 100644
--- a/tests/daemon/table/dead-nonce-list.t.cpp
+++ b/tests/daemon/table/dead-nonce-list.t.cpp
@@ -110,7 +110,7 @@
   scheduler::ScopedEventId addNonceEvent;
 };
 
-const time::nanoseconds PeriodicalInsertionFixture::LIFETIME = time::milliseconds(200);
+const time::nanoseconds PeriodicalInsertionFixture::LIFETIME = 200_ms;
 
 BOOST_FIXTURE_TEST_CASE(Lifetime, PeriodicalInsertionFixture)
 {
diff --git a/tests/daemon/table/measurements.t.cpp b/tests/daemon/table/measurements.t.cpp
index 915a049..23034a3 100644
--- a/tests/daemon/table/measurements.t.cpp
+++ b/tests/daemon/table/measurements.t.cpp
@@ -208,11 +208,11 @@
   Entry& entryC = measurements.get(nameC);
   BOOST_CHECK_EQUAL(measurements.size(), 3);
 
-  const time::nanoseconds EXTEND_A = time::seconds(2);
-  const time::nanoseconds CHECK1 = time::seconds(3);
-  const time::nanoseconds CHECK2 = time::seconds(5);
-  const time::nanoseconds EXTEND_C = time::seconds(6);
-  const time::nanoseconds CHECK3 = time::seconds(7);
+  const time::nanoseconds EXTEND_A = 2_s;
+  const time::nanoseconds CHECK1 = 3_s;
+  const time::nanoseconds CHECK2 = 5_s;
+  const time::nanoseconds EXTEND_C = 6_s;
+  const time::nanoseconds CHECK3 = 7_s;
   BOOST_ASSERT(EXTEND_A < CHECK1);
   BOOST_ASSERT(CHECK1 < Measurements::getInitialLifetime());
   BOOST_ASSERT(Measurements::getInitialLifetime() < CHECK2);
@@ -226,19 +226,19 @@
   //   B = initial lifetime
   //   C = EXTEND_C
 
-  this->advanceClocks(time::milliseconds(100), CHECK1);
+  this->advanceClocks(100_ms, CHECK1);
   BOOST_CHECK(measurements.findExactMatch(nameA) != nullptr);
   BOOST_CHECK(measurements.findExactMatch(nameB) != nullptr);
   BOOST_CHECK(measurements.findExactMatch(nameC) != nullptr);
   BOOST_CHECK_EQUAL(measurements.size(), 3);
 
-  this->advanceClocks(time::milliseconds(100), CHECK2 - CHECK1);
+  this->advanceClocks(100_ms, CHECK2 - CHECK1);
   BOOST_CHECK(measurements.findExactMatch(nameA) == nullptr);
   BOOST_CHECK(measurements.findExactMatch(nameB) == nullptr);
   BOOST_CHECK(measurements.findExactMatch(nameC) != nullptr);
   BOOST_CHECK_EQUAL(measurements.size(), 1);
 
-  this->advanceClocks(time::milliseconds(100), CHECK3 - CHECK2);
+  this->advanceClocks(100_ms, CHECK3 - CHECK2);
   BOOST_CHECK(measurements.findExactMatch(nameA) == nullptr);
   BOOST_CHECK(measurements.findExactMatch(nameB) == nullptr);
   BOOST_CHECK(measurements.findExactMatch(nameC) == nullptr);
@@ -252,7 +252,7 @@
   measurements.get("/A");
   BOOST_CHECK_EQUAL(measurements.size(), 1);
 
-  this->advanceClocks(Measurements::getInitialLifetime() + time::milliseconds(10));
+  this->advanceClocks(Measurements::getInitialLifetime() + 10_ms);
   BOOST_CHECK_EQUAL(measurements.size(), 0);
   BOOST_CHECK_EQUAL(nameTree.size(), nNameTreeEntriesBefore);
 }
diff --git a/tests/daemon/table/name-tree.t.cpp b/tests/daemon/table/name-tree.t.cpp
index 4e325bc..b42de83 100644
--- a/tests/daemon/table/name-tree.t.cpp
+++ b/tests/daemon/table/name-tree.t.cpp
@@ -668,7 +668,7 @@
     .end();
 }
 
-BOOST_AUTO_TEST_SUITE_END()
+BOOST_AUTO_TEST_SUITE_END() // IteratorPartialEnumerate
 
 BOOST_FIXTURE_TEST_CASE(IteratorFindAllMatches, EnumerationFixture)
 {
diff --git a/tests/daemon/table/network-region-table.t.cpp b/tests/daemon/table/network-region-table.t.cpp
index 11948bc..12865c6 100644
--- a/tests/daemon/table/network-region-table.t.cpp
+++ b/tests/daemon/table/network-region-table.t.cpp
@@ -56,8 +56,8 @@
   BOOST_CHECK_EQUAL(nrt4.isInProducerRegion(fh), true);
 }
 
-BOOST_AUTO_TEST_SUITE_END()
-BOOST_AUTO_TEST_SUITE_END()
+BOOST_AUTO_TEST_SUITE_END() // TestNetworkRegionTable
+BOOST_AUTO_TEST_SUITE_END() // Table
 
 } // namespace tests
 } // namespace nfd
diff --git a/tests/daemon/table/pit-entry.t.cpp b/tests/daemon/table/pit-entry.t.cpp
index a155be2..f46aa38 100644
--- a/tests/daemon/table/pit-entry.t.cpp
+++ b/tests/daemon/table/pit-entry.t.cpp
@@ -52,7 +52,7 @@
   BOOST_CHECK_EQUAL(entry.canMatch(*interest2), true);
 
   shared_ptr<Interest> interest3 = makeInterest("/A");
-  interest3->setInterestLifetime(time::milliseconds(6210));
+  interest3->setInterestLifetime(6210_ms);
   BOOST_CHECK_EQUAL(entry.canMatch(*interest3), true);
 
   shared_ptr<Interest> interest4 = makeInterest("/A");
@@ -71,16 +71,16 @@
   Name name("ndn:/KuYfjtRq");
   shared_ptr<Interest> interest  = makeInterest(name);
   shared_ptr<Interest> interest1 = makeInterest(name);
-  interest1->setInterestLifetime(time::milliseconds(2528));
+  interest1->setInterestLifetime(2528_ms);
   interest1->setNonce(25559);
   shared_ptr<Interest> interest2 = makeInterest(name);
-  interest2->setInterestLifetime(time::milliseconds(6464));
+  interest2->setInterestLifetime(6464_ms);
   interest2->setNonce(19004);
   shared_ptr<Interest> interest3 = makeInterest(name);
-  interest3->setInterestLifetime(time::milliseconds(3585));
+  interest3->setInterestLifetime(3585_ms);
   interest3->setNonce(24216);
   shared_ptr<Interest> interest4 = makeInterest(name);
-  interest4->setInterestLifetime(time::milliseconds(8795));
+  interest4->setInterestLifetime(8795_ms);
   interest4->setNonce(17365);
 
   Entry entry(*interest);
diff --git a/tests/daemon/table/pit.t.cpp b/tests/daemon/table/pit.t.cpp
index 7c6d791..5b051fb 100644
--- a/tests/daemon/table/pit.t.cpp
+++ b/tests/daemon/table/pit.t.cpp
@@ -145,7 +145,7 @@
 
   // A+InterestLifetime
   shared_ptr<Interest> interestK = make_shared<Interest>(*interestA);
-  interestK->setInterestLifetime(time::milliseconds(1000));
+  interestK->setInterestLifetime(1_s);
   insertResult = pit.insert(*interestK);
   BOOST_CHECK_EQUAL(insertResult.second, false); // only guiders differ
   BOOST_CHECK_EQUAL(pit.size(), 9);
@@ -391,8 +391,8 @@
   }
 }
 
-BOOST_AUTO_TEST_SUITE_END()
-BOOST_AUTO_TEST_SUITE_END()
+BOOST_AUTO_TEST_SUITE_END() // TestPit
+BOOST_AUTO_TEST_SUITE_END() // Table
 
 } // namespace tests
 } // namespace pit
diff --git a/tests/other/face-benchmark.cpp b/tests/other/face-benchmark.cpp
index 3ab1dda..cdda120 100644
--- a/tests/other/face-benchmark.cpp
+++ b/tests/other/face-benchmark.cpp
@@ -47,7 +47,7 @@
     : m_terminationSignalSet{getGlobalIoService()}
     , m_tcpChannel{tcp::Endpoint{boost::asio::ip::tcp::v4(), 6363}, false,
                    bind([] { return ndn::nfd::FACE_SCOPE_NON_LOCAL; })}
-    , m_udpChannel{udp::Endpoint{boost::asio::ip::udp::v4(), 6363}, time::minutes{10}, false}
+    , m_udpChannel{udp::Endpoint{boost::asio::ip::udp::v4(), 6363}, 10_min, false}
   {
     m_terminationSignalSet.add(SIGINT);
     m_terminationSignalSet.add(SIGTERM);
diff --git a/tests/tools/ndn-autoconfig/multicast-discovery.t.cpp b/tests/tools/ndn-autoconfig/multicast-discovery.t.cpp
index 0e08a36..62d8bf1 100644
--- a/tests/tools/ndn-autoconfig/multicast-discovery.t.cpp
+++ b/tests/tools/ndn-autoconfig/multicast-discovery.t.cpp
@@ -124,7 +124,7 @@
   });
 
   stage.start();
-  face.processEvents(time::seconds(20));
+  face.processEvents(20_s);
   BOOST_CHECK(hasSuccess);
 }
 
diff --git a/tests/tools/nfdc/forwarder-general-module.t.cpp b/tests/tools/nfdc/forwarder-general-module.t.cpp
index ed87b71..ad282a3 100644
--- a/tests/tools/nfdc/forwarder-general-module.t.cpp
+++ b/tests/tools/nfdc/forwarder-general-module.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018,  Regents of the University of California,
+ * Copyright (c) 2014-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -91,8 +91,8 @@
   this->fetchStatus();
   ForwarderStatus payload;
   payload.setNfdVersion("0.4.1-1-g704430c")
-         .setStartTimestamp(time::fromUnixTimestamp(time::milliseconds(1466781226856)))
-         .setCurrentTimestamp(time::fromUnixTimestamp(time::milliseconds(1468778154109)))
+         .setStartTimestamp(time::fromUnixTimestamp(1466781226856_ms))
+         .setCurrentTimestamp(time::fromUnixTimestamp(1468778154109_ms))
          .setNNameTreeEntries(668)
          .setNFibEntries(70)
          .setNPitEntries(7)
diff --git a/tests/tools/nfdc/rib-module.t.cpp b/tests/tools/nfdc/rib-module.t.cpp
index 919b43a..624fca6 100644
--- a/tests/tools/nfdc/rib-module.t.cpp
+++ b/tests/tools/nfdc/rib-module.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2018,  Regents of the University of California,
+ * Copyright (c) 2014-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -53,7 +53,7 @@
                       .setOrigin(ndn::nfd::ROUTE_ORIGIN_CLIENT)
                       .setCost(2956)
                       .setFlags(ndn::nfd::ROUTE_FLAG_CHILD_INHERIT | ndn::nfd::ROUTE_FLAG_CAPTURE)
-                      .setExpirationPeriod(time::milliseconds(29950035)));
+                      .setExpirationPeriod(29950035_ms));
     entry1.addRoute(Route()
                       .setFaceId(6720)
                       .setOrigin(ndn::nfd::ROUTE_ORIGIN_STATIC)
@@ -248,10 +248,10 @@
     BOOST_CHECK_EQUAL(req.getFlags(), ndn::nfd::ROUTE_FLAG_CHILD_INHERIT |
                                       ndn::nfd::ROUTE_FLAG_CAPTURE);
     BOOST_REQUIRE_EQUAL(req.hasExpirationPeriod(), true);
-    BOOST_REQUIRE_EQUAL(req.getExpirationPeriod(), time::milliseconds(727411987));
+    BOOST_REQUIRE_EQUAL(req.getExpirationPeriod(), 727411987_ms);
 
     ControlParameters resp = req;
-    resp.setExpirationPeriod(time::milliseconds(727411154)); // server side may change expiration
+    resp.setExpirationPeriod(727411154_ms); // server side may change expiration
     this->succeedCommand(interest, resp);
   };
 
@@ -530,7 +530,7 @@
                            .setOrigin(ndn::nfd::ROUTE_ORIGIN_STATIC)
                            .setCost(79)
                            .setFlags(ndn::nfd::ROUTE_FLAG_CHILD_INHERIT)
-                           .setExpirationPeriod(time::milliseconds(47292)));
+                           .setExpirationPeriod(47292_ms));
   RibEntry payload2;
   payload2.setName("/localhost/nfd")
           .addRoute(Route().setFaceId(258)
diff --git a/tests/tools/nfdc/status-fixture.hpp b/tests/tools/nfdc/status-fixture.hpp
index e1974b9..f33f6bb 100644
--- a/tests/tools/nfdc/status-fixture.hpp
+++ b/tests/tools/nfdc/status-fixture.hpp
@@ -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-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -28,6 +28,7 @@
 
 #include "mock-nfd-mgmt-fixture.hpp"
 #include "nfdc/module.hpp"
+
 #include <ndn-cxx/security/validator-null.hpp>
 
 namespace nfd {
@@ -87,7 +88,7 @@
                          BOOST_FAIL("fetchStatus failure " << code << " " << reason);
                        },
                        CommandOptions());
-    this->advanceClocks(time::milliseconds(1));
+    this->advanceClocks(1_ms);
   }
 
   /** \brief prepare status output as XML and text
@@ -96,7 +97,7 @@
   void
   prepareStatusOutput()
   {
-    this->advanceClocks(time::milliseconds(1));
+    this->advanceClocks(1_ms);
     BOOST_REQUIRE_EQUAL(nFetchStatusSuccess, 1);
 
     statusXml.str("");
diff --git a/tests/tools/nfdc/status-report.t.cpp b/tests/tools/nfdc/status-report.t.cpp
index 7c8e32c..5041fb3 100644
--- a/tests/tools/nfdc/status-report.t.cpp
+++ b/tests/tools/nfdc/status-report.t.cpp
@@ -52,7 +52,7 @@
     : m_moduleName(moduleName)
     , m_scheduler(io)
     , m_res(0)
-    , m_delay(time::milliseconds(1))
+    , m_delay(1_ms)
   {
   }
 
@@ -174,11 +174,11 @@
 BOOST_AUTO_TEST_CASE(Normal)
 {
   DummyModule& m1 = addModule("module1");
-  m1.setResult(0, time::milliseconds(10));
+  m1.setResult(0, 10_ms);
   DummyModule& m2 = addModule("module2");
-  m2.setResult(0, time::milliseconds(20));
+  m2.setResult(0, 20_ms);
 
-  this->collect(time::milliseconds(5), 6);
+  this->collect(5_ms, 6);
 
   BOOST_CHECK_EQUAL(m1.nFetchStatusCalls, 1);
   BOOST_CHECK_EQUAL(m2.nFetchStatusCalls, 1);
@@ -191,11 +191,11 @@
 BOOST_AUTO_TEST_CASE(Reorder)
 {
   DummyModule& m1 = addModule("module1");
-  m1.setResult(0, time::milliseconds(20));
+  m1.setResult(0, 20_ms);
   DummyModule& m2 = addModule("module2");
-  m2.setResult(0, time::milliseconds(10)); // module2 completes earlier than module1
+  m2.setResult(0, 10_ms); // module2 completes earlier than module1
 
-  this->collect(time::milliseconds(5), 6);
+  this->collect(5_ms, 6);
 
   BOOST_CHECK_EQUAL(res, 0);
   BOOST_CHECK(statusXml.is_equal(STATUS_XML)); // output is still in order
@@ -205,11 +205,11 @@
 BOOST_AUTO_TEST_CASE(Error)
 {
   DummyModule& m1 = addModule("module1");
-  m1.setResult(0, time::milliseconds(20));
+  m1.setResult(0, 20_ms);
   DummyModule& m2 = addModule("module2");
-  m2.setResult(500, time::milliseconds(10));
+  m2.setResult(500, 10_ms);
 
-  this->collect(time::milliseconds(5), 6);
+  this->collect(5_ms, 6);
 
   BOOST_CHECK_EQUAL(res, 1000500);
 }
diff --git a/tools/ndn-autoconfig-server/program.cpp b/tools/ndn-autoconfig-server/program.cpp
index 8f624b8..d0be0d1 100644
--- a/tools/ndn-autoconfig-server/program.cpp
+++ b/tools/ndn-autoconfig-server/program.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-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -35,9 +35,9 @@
 namespace tools {
 namespace autoconfig_server {
 
-static const Name HUB_DATA_NAME("/localhop/ndn-autoconf/hub");
-static const Name ROUTABLE_PREFIXES_DATA_PREFIX("/localhop/nfd");
-static const PartialName ROUTABLE_PREFIXES_DATA_SUFFIX("rib/routable-prefixes");
+const Name HUB_DATA_NAME("/localhop/ndn-autoconf/hub");
+const Name ROUTABLE_PREFIXES_DATA_PREFIX("/localhop/nfd");
+const PartialName ROUTABLE_PREFIXES_DATA_SUFFIX("rib/routable-prefixes");
 
 Program::Program(const Options& options, Face& face, KeyChain& keyChain)
   : m_face(face)
@@ -56,7 +56,7 @@
   std::string uri = hubFaceUri.toString();
 
   auto data = make_shared<Data>(Name(HUB_DATA_NAME).appendVersion());
-  data->setFreshnessPeriod(time::hours(1));
+  data->setFreshnessPeriod(1_h);
   data->setContent(makeBinaryBlock(tlv::nfd::Uri,
                                    reinterpret_cast<const uint8_t*>(uri.data()), uri.size()));
   m_keyChain.sign(*data);
@@ -75,7 +75,7 @@
 {
   m_dispatcher.addStatusDataset(ROUTABLE_PREFIXES_DATA_SUFFIX,
     mgmt::makeAcceptAllAuthorization(),
-    [=] (const Name& prefix, const Interest& interest, mgmt::StatusDatasetContext& context) {
+    [=] (const Name&, const Interest&, mgmt::StatusDatasetContext& context) {
       for (const Name& routablePrefix : routablePrefixes) {
         context.append(routablePrefix.wireEncode());
       }
@@ -84,8 +84,8 @@
   m_dispatcher.addTopPrefix(ROUTABLE_PREFIXES_DATA_PREFIX, false);
 
   m_face.registerPrefix(Name(ROUTABLE_PREFIXES_DATA_PREFIX).append(ROUTABLE_PREFIXES_DATA_SUFFIX),
-    nullptr,
-    bind(&Program::handlePrefixRegistrationFailure, this, _1, _2));
+                        nullptr,
+                        bind(&Program::handlePrefixRegistrationFailure, this, _1, _2));
 }
 
 void
diff --git a/tools/ndn-autoconfig/main.cpp b/tools/ndn-autoconfig/main.cpp
index e69ef89..859ed34 100644
--- a/tools/ndn-autoconfig/main.cpp
+++ b/tools/ndn-autoconfig/main.cpp
@@ -49,12 +49,12 @@
 namespace tools {
 namespace autoconfig {
 
-static const time::nanoseconds DAEMON_INITIAL_DELAY = 100_ms;
-static const time::nanoseconds DAEMON_UNCONDITIONAL_INTERVAL = 1_h;
-static const time::nanoseconds NETMON_DAMPEN_PERIOD = 5_s;
-
 namespace po = boost::program_options;
 
+const time::nanoseconds DAEMON_INITIAL_DELAY = 100_ms;
+const time::nanoseconds DAEMON_UNCONDITIONAL_INTERVAL = 1_h;
+const time::nanoseconds NETMON_DAMPEN_PERIOD = 5_s;
+
 static void
 usage(std::ostream& os,
       const po::options_description& opts,
diff --git a/tools/ndn-autoconfig/multicast-discovery.cpp b/tools/ndn-autoconfig/multicast-discovery.cpp
index c74d5f3..1baf831 100644
--- a/tools/ndn-autoconfig/multicast-discovery.cpp
+++ b/tools/ndn-autoconfig/multicast-discovery.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-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -24,7 +24,9 @@
  */
 
 #include "multicast-discovery.hpp"
+
 #include <boost/lexical_cast.hpp>
+
 #include <ndn-cxx/encoding/tlv-nfd.hpp>
 
 namespace ndn {
@@ -34,10 +36,10 @@
 using nfd::ControlParameters;
 using nfd::ControlResponse;
 
-static const Name HUB_DISCOVERY_PREFIX("/localhop/ndn-autoconf/hub");
-static const uint64_t HUB_DISCOVERY_ROUTE_COST(1);
-static const time::milliseconds HUB_DISCOVERY_ROUTE_EXPIRATION = time::seconds(30);
-static const time::milliseconds HUB_DISCOVERY_INTEREST_LIFETIME = time::seconds(4);
+const Name HUB_DISCOVERY_PREFIX("/localhop/ndn-autoconf/hub");
+const uint64_t HUB_DISCOVERY_ROUTE_COST(1);
+const time::milliseconds HUB_DISCOVERY_ROUTE_EXPIRATION = 30_s;
+const time::milliseconds HUB_DISCOVERY_INTEREST_LIFETIME = 4_s;
 
 MulticastDiscovery::MulticastDiscovery(Face& face, nfd::Controller& controller)
   : m_face(face)
diff --git a/tools/ndn-autoconfig/procedure.cpp b/tools/ndn-autoconfig/procedure.cpp
index fff88f7..dded94b 100644
--- a/tools/ndn-autoconfig/procedure.cpp
+++ b/tools/ndn-autoconfig/procedure.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-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -36,10 +36,10 @@
 using nfd::ControlParameters;
 using nfd::ControlResponse;
 
-static const time::nanoseconds FACEURI_CANONIZE_TIMEOUT = time::seconds(4);
-static const std::vector<Name> HUB_PREFIXES{"/", "/localhop/nfd"};
-static const nfd::RouteOrigin HUB_ROUTE_ORIGIN = nfd::ROUTE_ORIGIN_AUTOCONF;
-static const uint64_t HUB_ROUTE_COST = 100;
+const time::nanoseconds FACEURI_CANONIZE_TIMEOUT = 4_s;
+const std::vector<Name> HUB_PREFIXES{"/", "/localhop/nfd"};
+const nfd::RouteOrigin HUB_ROUTE_ORIGIN = nfd::ROUTE_ORIGIN_AUTOCONF;
+const uint64_t HUB_ROUTE_COST = 100;
 
 Procedure::Procedure(Face& face, KeyChain& keyChain)
   : m_face(face)
diff --git a/tools/nfdc/execute-command.cpp b/tools/nfdc/execute-command.cpp
index 92f1631..7067ebf 100644
--- a/tools/nfdc/execute-command.cpp
+++ b/tools/nfdc/execute-command.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-2019,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -32,7 +32,7 @@
 time::nanoseconds
 ExecuteContext::getTimeout() const
 {
-  return time::seconds(4);
+  return 4_s;
 }
 
 ndn::nfd::CommandOptions
