comparison server/ts.py @ 99:1a88bb989afb

fix off-by-one in remainder code
author Matt Johnston <matt@ucc.asn.au>
date Tue, 17 Jul 2012 21:58:49 +0800
parents 229b740a607f
children 9485da05bc11
comparison
equal deleted inserted replaced
95:fd9cfa6829fd 99:1a88bb989afb
106 106
107 toks = dict(v.split('=') for v in l.split(',')) 107 toks = dict(v.split('=') for v in l.split(','))
108 108
109 rem = int(toks['rem']) 109 rem = int(toks['rem'])
110 tick_secs = int(toks['tick_secs']) 110 tick_secs = int(toks['tick_secs'])
111 tick_secs = int(toks['tick_wake']) 111 tick_wake = int(toks['tick_wake']) + 1
112 next_wake = int(toks['next_wake']) 112 next_wake = int(toks['next_wake'])
113 113
114 rem_secs = float(rem) / tick_wake * tick_secs 114 rem_secs = float(rem) / tick_wake * tick_secs
115 115
116 next_wake_secs = next_wake - rem_secs 116 next_wake_secs = next_wake - rem_secs