Python time.CLOCK_MONOTONIC Examples

The following are 8 code examples for showing how to use time.CLOCK_MONOTONIC(). These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.

You may check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module time , or try the search function .

Example 1
Project: Fluid-Designer   Author: Microvellum   File: test_time.py    License: GNU General Public License v3.0 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 2
Project: Fluid-Designer   Author: Microvellum   File: test_time.py    License: GNU General Public License v3.0 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 3
Project: ironpython3   Author: IronLanguages   File: test_time.py    License: Apache License 2.0 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 4
Project: ironpython3   Author: IronLanguages   File: test_time.py    License: Apache License 2.0 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: Project-New-Reign---Nemesis-Main   Author: ShikyoKira   File: test_time.py    License: GNU General Public License v3.0 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: Project-New-Reign---Nemesis-Main   Author: ShikyoKira   File: test_time.py    License: GNU General Public License v3.0 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 7
Project: android_universal   Author: bkerler   File: test_time.py    License: MIT License 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 8
Project: android_universal   Author: bkerler   File: test_time.py    License: MIT License 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)