#!/usr/bin/env python3 """Freeze detector""" from time import sleep, time tt = 0.01 print('Freeze detection started!') while True: x = time() sleep(1) y = time() z = y - x a = z - 1 if a > tt: print( 'Freeze detected; freeze duration: {} sec'.format( round(a, 3)))