comparison server/ts.py @ 405:d9b78a1bdd1d

fix off-by-one in remainder code
author Matt Johnston <matt@ucc.asn.au>
date Tue, 17 Jul 2012 21:58:49 +0800
parents 1137f315209b
children 9485da05bc11
comparison
equal deleted inserted replaced
401:56c32a62b0cd 405:d9b78a1bdd1d
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