Fix time taken

This commit is contained in:
David Buxton 2015-09-01 18:39:40 -04:00
parent b567bde9c0
commit e420a3eb41
2 changed files with 6 additions and 2 deletions

View File

@ -794,8 +794,12 @@ class StatusCheckResult(models.Model):
@property @property
def took(self): def took(self):
"""
Time taken by check in ms
"""
try: try:
return (self.time_complete - self.time).microseconds / 1000 diff = (self.time_complete - self.time).microseconds
return (diff.microseconds + (diff.seconds + diff.days * 24 * 3600) * 10**6) / 1000
except: except:
return None return None

View File

@ -35,7 +35,7 @@
<th>Status</th> <th>Status</th>
<th>Time started</th> <th>Time started</th>
<th>Time complete</th> <th>Time complete</th>
<th>Took</th> <th>Took (ms)</th>
<th>Error</th> <th>Error</th>
</tr> </tr>
</thead> </thead>