Don't bother with fractional nanoseconds.

<1 nanosecond is well below the threshold we can measure,
everything becomes simpler with integers, and they're easier
to skim.
This commit is contained in:
Tommi Virtanen 2011-07-26 09:43:56 -07:00
parent f21b410154
commit 3eb53db2b3

View file

@ -23,7 +23,7 @@ class RandomContentFile(object):
self.seek(0) self.seek(0)
def _mark_chunk(self): def _mark_chunk(self):
self.chunks.append([self.offset, (time.time() - self.last_seek) * NANOSECOND]) self.chunks.append([self.offset, int(round((time.time() - self.last_seek) * NANOSECOND))])
def seek(self, offset): def seek(self, offset):
assert offset == 0 assert offset == 0
@ -93,7 +93,7 @@ class FileVerifier(object):
self.chunks = [] self.chunks = []
def _mark_chunk(self): def _mark_chunk(self):
self.chunks.append([self.size, (time.time() - self.created_at) * NANOSECOND]) self.chunks.append([self.size, int(round((time.time() - self.created_at) * NANOSECOND))])
def write(self, data): def write(self, data):
self.size += len(data) self.size += len(data)