()
| 21 | |
| 22 | |
| 23 | def mem(): |
| 24 | pattern = re.compile(r"^(\d*)([MG]B)$") |
| 25 | size = sys.argv[2].upper() |
| 26 | match = pattern.match(size) |
| 27 | if match: |
| 28 | num = int(match.group(1)) |
| 29 | unit = match.group(2) |
| 30 | if unit == "MB": |
| 31 | s = " " * (num * 1024 * 1024) |
| 32 | else: |
| 33 | s = " " * (num * 1024 * 1024 * 1024) |
| 34 | time.sleep(24 * 3600) |
| 35 | else: |
| 36 | print("bad args.....") |
| 37 | print_help() |
| 38 | |
| 39 | |
| 40 | # cpu usage |
nothing calls this directly
no test coverage detected