Python time.CLOCK_MONOTONIC() Examples

The following are code examples for showing how to use time.CLOCK_MONOTONIC(). They are extracted from open source Python projects. You can vote up the examples you like or vote down the ones you don't like. You can also save this page to your account.

Example 1
Project: ouroboros   Author: pybee   File: test_time.py    (license) View Source Project 6 votes vote down vote up
def test_clock_monotonic(self):
        a = time.clock_gettime(time.CLOCK_MONOTONIC)
        b = time.clock_gettime(time.CLOCK_MONOTONIC)
        self.assertLessEqual(a, b) 
Example 2
Project: web_ctp   Author: molebot   File: test_time.py    (license) View Source Project 5 votes vote down vote up
def test_clock_monotonic(self):
        a = time.clock_gettime(time.CLOCK_MONOTONIC)
        b = time.clock_gettime(time.CLOCK_MONOTONIC)
        self.assertLessEqual(a, b) 
Example 3
Project: web_ctp   Author: molebot   File: test_time.py    (license) View Source Project 5 votes vote down vote up
def test_clock_settime(self):
        t = time.clock_gettime(time.CLOCK_REALTIME)
        try:
            time.clock_settime(time.CLOCK_REALTIME, t)
        except PermissionError:
            pass

        if hasattr(time, 'CLOCK_MONOTONIC'):
            self.assertRaises(OSError,
                              time.clock_settime, time.CLOCK_MONOTONIC, 0) 
Example 4
Project: ouroboros   Author: pybee   File: test_time.py    (license) View Source Project 5 votes vote down vote up
def test_clock_settime(self):
        t = time.clock_gettime(time.CLOCK_REALTIME)
        try:
            time.clock_settime(time.CLOCK_REALTIME, t)
        except PermissionError:
            pass

        if hasattr(time, 'CLOCK_MONOTONIC'):
            self.assertRaises(OSError,
                              time.clock_settime, time.CLOCK_MONOTONIC, 0) 
Example 5
Project: kbe_server   Author: xiaohaoppy   File: test_time.py    (license) View Source Project 5 votes vote down vote up
def test_clock_monotonic(self):
        a = time.clock_gettime(time.CLOCK_MONOTONIC)
        b = time.clock_gettime(time.CLOCK_MONOTONIC)
        self.assertLessEqual(a, b) 
Example 6
Project: kbe_server   Author: xiaohaoppy   File: test_time.py    (license) View Source Project 5 votes vote down vote up
def test_clock_settime(self):
        t = time.clock_gettime(time.CLOCK_REALTIME)
        try:
            time.clock_settime(time.CLOCK_REALTIME, t)
        except PermissionError:
            pass

        if hasattr(time, 'CLOCK_MONOTONIC'):
            self.assertRaises(OSError,
                              time.clock_settime, time.CLOCK_MONOTONIC, 0)