17 lines
443 B
Python
17 lines
443 B
Python
import sys
|
|
import time
|
|
|
|
|
|
def main() -> None:
|
|
seconds = int(sys.argv[1]) if len(sys.argv) > 1 else 20
|
|
print(f"Demo job started, running for {seconds} seconds.", flush=True)
|
|
for elapsed in range(1, seconds + 1):
|
|
time.sleep(1)
|
|
if elapsed % 5 == 0:
|
|
print(f"Progress: {elapsed}/{seconds} seconds.", flush=True)
|
|
print("Demo job finished successfully.", flush=True)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|