lyyc001 发表于 2021-2-23 14:45

python3 CPU暖手,暖脚器

# coding=utf-8

from os import cpu_count
from time import strftime, sleep
from multiprocessing import Process, freeze_support

def full():
    number = 0
    while True:
      if number > 10000:
            number = 0
      number += 1

def showTime():
    while True:
      print(f'\r本地时间:{strftime("%Y-%m-%d %H:%M:%S")}', end='', flush=True)
      sleep(1)

if __name__ == '__main__':
    freeze_support()
    kernel = cpu_count()
    print(f'CPU 暖手器已开启 {kernel} 个核心')
    pro =
    for p in pro: p.start()
    showTime()    for p in pro: p.join()





毒盘链接:https://pan.baidu.com/s/1AJyhxvS-m-lfzQMgtuKIyQ
提取码x7eg

525250342 发表于 2021-2-23 14:49

谢谢大佬分享

p5268805 发表于 2021-2-23 15:01

谢谢分享

wangying 发表于 2021-2-23 15:10


支持楼主,谢谢分享。

梁成武爱 发表于 2021-2-23 15:12

感谢楼主分享

smzya 发表于 2021-2-23 15:31


感谢楼主的分享

shenohe 发表于 2021-2-23 16:04

多谢楼主分享

阿列 发表于 2021-2-23 16:05

谢谢@Thanks!

mengzhisuoliu2 发表于 2021-2-23 16:05

多谢分享多谢分享

q2508703441 发表于 2021-2-24 00:19


感谢分享,谢谢提供分享
页: [1]
查看完整版本: python3 CPU暖手,暖脚器