Close #10278: Add time.wallclock() function, monotonic clock.
diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py
index a73588c..ede85b7 100644
--- a/Lib/test/test_time.py
+++ b/Lib/test/test_time.py
@@ -332,6 +332,13 @@
self.assertEqual(time.strftime('%Z', tt), tzname)
+ def test_wallclock(self):
+ t0 = time.wallclock()
+ time.sleep(0.1)
+ t1 = time.wallclock()
+ t = t1 - t0
+ self.assertAlmostEqual(t, 0.1, places=2)
+
class TestLocale(unittest.TestCase):
def setUp(self):
self.oldloc = locale.setlocale(locale.LC_ALL)