Administrator
2023-10-16 5ed30c03ddfedd4cf79cd8fea9fc45b05821d898
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import multiprocessing
import queue
import time
 
from l2.cancel_buy_strategy import LCancelRateManager
 
__queue = queue.Queue()
 
 
def add_data(msg):
    time.sleep(1)
    start_time = time.time()
    __queue.put({"msg": msg})
    end_time = time.time()
    if end_time - start_time > 0.002:
        print("加入日志耗时")
 
 
def test_process_1(pipe):
    while True:
        for i in range(10):
            pipe.send_bytes(f"hello world:{i}".encode("utf-8"))
            time.sleep(1)
 
 
def test_process_2(pipe):
    while True:
        results = pipe.recv_bytes()
        if results:
            print("接受到内容:", results)
 
 
if __name__ == "__main__":
    code = "000333"
    LCancelRateManager.set_block_limit_up_count(code, 100)
    LCancelRateManager.set_big_num_deal_rate(code, 10)
    print(LCancelRateManager.get_cancel_rate(code))