Skip to content
Snippets Groups Projects
time-test.py 406 B
Newer Older
  • Learn to ignore specific revisions
  • Sara Falcone's avatar
    Sara Falcone committed
    import time
    
    def delay(func, time):
        t_end = time.time() + time
        while time.time() < t_end:
            self.func()
        print("OUT OF LOOP")
        
    def func(self):
        print("in LOOP")
    
        
    if __name__ == "__main__":
        print("in main")
        length = 3
        delay(func, length)
        
        
        # testing passing a function into a function
        # so dalay function can be used to stop drive robot commands