Update select_ticket_info.py

字符串判断改为时间戳判断
pull/605/head
nerd4me 2019-12-24 21:55:21 +08:00 committed by GitHub
parent 6b11a993b8
commit 74208e1f0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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')}")