wangkun 1 year ago
parent
commit
8be7b86b9a
1 changed files with 24 additions and 0 deletions
  1. 24 0
      gongzhonghao/gongzhonghao_main/run_test.py

+ 24 - 0
gongzhonghao/gongzhonghao_main/run_test.py

@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+# @Author: wangkun
+# @Time: 2023/6/30
+import time
+from multiprocessing import Process
+
+
+def script():
+    while True:
+        print(f"{time.strftime('%H:%M:%S')}:==========")
+        time.sleep(10)
+
+
+def test(gzh_num):
+    crawler_num = int(gzh_num/100)
+    if gzh_num%100 != 0:
+        crawler_num += 1
+    print(crawler_num)
+    for i in range(crawler_num):
+        process = Process(target=script)
+        process.start()
+
+if __name__ == "__main__":
+    test(692)