File: busy_wait.py

package info (click to toggle)
python-pyinstrument 5.1.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,620 kB
  • sloc: python: 6,713; ansic: 897; makefile: 46; sh: 20; javascript: 18
file content (21 lines) | stat: -rw-r--r-- 239 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import time


def function_1():
    pass


def function_2():
    pass


def main():
    start_time = time.time()

    while time.time() < start_time + 0.25:
        function_1()
        function_2()


if __name__ == "__main__":
    main()