| | |
| | | if round(t.time() * 1000) - __start_time > 10: |
| | | __start_time = l2_data_log.l2_time(code, round(t.time() * 1000) - __start_time, |
| | | "获取m值数据耗时") |
| | | if True: # end_index - start_index < 10: |
| | | if False: # end_index - start_index < 10: |
| | | cls.__start_compute_buy(code, start_index, end_index, threshold_money, capture_time, is_first_code) |
| | | else: |
| | | pass |
| | | # lp = LineProfiler() |
| | | # lp.enable() |
| | | # lp_wrap = lp(cls.__start_compute_buy) |
| | | # lp_wrap(code, start_index, end_index, threshold_money, capture_time, is_first_code) |
| | | # output = io.StringIO() |
| | | # lp.print_stats(stream=output) |
| | | # lp.disable() |
| | | # with open( |
| | | # f"/home/logs/profile/{code}_start_compute_buy_{start_index}_{end_index}.txt", |
| | | # 'w') as f: |
| | | # f.write(output.getvalue()) |
| | | # pass |
| | | lp = LineProfiler() |
| | | lp.enable() |
| | | lp_wrap = lp(cls.__start_compute_buy) |
| | | lp_wrap(code, start_index, end_index, threshold_money, capture_time, is_first_code) |
| | | output = io.StringIO() |
| | | lp.print_stats(stream=output) |
| | | lp.disable() |
| | | with open( |
| | | f"/home/logs/profile/{code}_start_compute_buy_{start_index}_{end_index}.txt", |
| | | 'w') as f: |
| | | f.write(output.getvalue()) |
| | | |
| | | # 测试专用 |
| | | @classmethod |