This command will kill the task. The task will not be updated anymore and will be removed from the scheduler.
import viztask
def MyTask():
while True:
yield viztask.waitTime(1)
print('1 second elapsed')
t = viztask.schedule( MyTask() )
vizact.onkeydown('k',t.kill)