mirror of https://github.com/testerSunshine/12306
parent
6b11a993b8
commit
74208e1f0d
|
@ -136,8 +136,9 @@ class select:
|
|||
print(f"预售还未开始,阻塞中,预售时间为{TickerConfig.OPEN_TIME}, 当前时间为: {now.strftime('%H:%M:%S')}")
|
||||
sleep_time_s = 0.1
|
||||
sleep_time_t = 0.3
|
||||
open_time = datetime.datetime.strptime(TickerConfig.OPEN_TIME, '%Y-%m-%d %H:%M:%S')
|
||||
# 测试了一下有微妙级的误差,应该不影响,测试结果:2019-01-02 22:30:00.004555,预售还是会受到前一次刷新的时间影响,暂时没想到好的解决方案
|
||||
while now.strftime("%d:%H:%M:%S") < TickerConfig.OPEN_TIME:
|
||||
while now < open_time:
|
||||
now = datetime.datetime.now()
|
||||
time.sleep(0.0001)
|
||||
print(f"预售开始,开启时间为: {now.strftime('%H:%M:%S')}")
|
||||
|
|
Loading…
Reference in New Issue