Example #1
0
 def test_stop_microseconds(self):
     """Test that stop/sleep have right units."""
     watch = Stopwatch()
     watch.start()
     tic = time.time()
     watch.sleep(1)
     us = watch.stop()
     toc = time.time()
     self.assertAlmostEqual(us/1e6,(toc-tic),places=0)
Example #2
0
 def test_stop_microseconds(self):
     """Test that stop/sleep have right units."""
     watch = Stopwatch()
     watch.start()
     tic = time.time()
     watch.sleep(1)
     us = watch.stop()
     toc = time.time()
     self.assertAlmostEqual(us / 1e6, (toc - tic), places=0)