[+] update status
1. make sure it handles properly
time jumps due to suspend for example;
This commit is contained in:
parent
8633bd0724
commit
c0125914d2
@ -5,7 +5,7 @@ project(
|
|||||||
).stdout().strip('\n'),
|
).stdout().strip('\n'),
|
||||||
# 'online.fxreader.uv',
|
# 'online.fxreader.uv',
|
||||||
# ['c', 'cpp'],
|
# ['c', 'cpp'],
|
||||||
version: '0.1.5.43',
|
version: '0.1.5.44',
|
||||||
# default_options: [
|
# default_options: [
|
||||||
# 'cpp_std=c++23',
|
# 'cpp_std=c++23',
|
||||||
# # 'prefer_static=true',
|
# # 'prefer_static=true',
|
||||||
|
|||||||
@ -197,10 +197,25 @@ printf '% 3.0f%%' $(upower -d | grep -Po 'percentage:\\s+\\d+(\\.\\d+)?%' | grep
|
|||||||
sys.stdout.write('\n')
|
sys.stdout.write('\n')
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
now_ts = datetime.datetime.now()
|
is_late = False
|
||||||
spent = (now_ts - last_ts).total_seconds()
|
|
||||||
|
|
||||||
last_ts = last_ts + datetime.timedelta(seconds=options.repeat_interval)
|
new_ts = last_ts
|
||||||
|
|
||||||
|
while True:
|
||||||
|
now_ts = datetime.datetime.now()
|
||||||
|
spent = (now_ts - last_ts).total_seconds()
|
||||||
|
|
||||||
|
new_ts = last_ts + datetime.timedelta(
|
||||||
|
seconds=options.repeat_interval
|
||||||
|
)
|
||||||
|
|
||||||
|
if new_ts > now_ts:
|
||||||
|
if is_late:
|
||||||
|
last_ts = new_ts
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
last_ts = new_ts
|
||||||
|
is_late = True
|
||||||
|
|
||||||
if spent < options.repeat_interval:
|
if spent < options.repeat_interval:
|
||||||
time.sleep(options.repeat_interval - spent)
|
time.sleep(options.repeat_interval - spent)
|
||||||
|
|||||||
BIN
releases/whl/online_fxreader_pr34-0.1.5.44-py3-none-any.whl
(Stored with Git LFS)
Normal file
BIN
releases/whl/online_fxreader_pr34-0.1.5.44-py3-none-any.whl
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user