Merge pull request #294 from rafalste/fix_timedelta_precision
Fix timedelta precision by importing attotimedelta instead
This commit is contained in:
commit
445f0cb9b0
@ -177,8 +177,7 @@ class Cache:
|
||||
if alru_params.staleness_time else None,
|
||||
alru_params.flush_max_buffers
|
||||
if alru_params.flush_max_buffers else None,
|
||||
int(alru_params.activity_threshold.total_seconds()
|
||||
* 1000)
|
||||
alru_params.activity_threshold.total_milliseconds()
|
||||
if alru_params.activity_threshold else None)
|
||||
|
||||
def get_cache_config(self):
|
||||
|
@ -6,7 +6,7 @@
|
||||
from enum import IntEnum
|
||||
from aenum import Enum
|
||||
from test_utils.size import Size, Unit
|
||||
from datetime import timedelta
|
||||
from attotime import attotimedelta
|
||||
|
||||
|
||||
class CacheLineSize(Enum):
|
||||
@ -79,7 +79,7 @@ class CacheStatus(Enum):
|
||||
incomplete = 5
|
||||
|
||||
|
||||
class Time(timedelta):
|
||||
class Time(attotimedelta):
|
||||
def total_milliseconds(self):
|
||||
return int(self.total_seconds() * 1000)
|
||||
|
||||
|
1
test/functional/requirements.txt
Normal file
1
test/functional/requirements.txt
Normal file
@ -0,0 +1 @@
|
||||
attotime>=0.2.0
|
Loading…
Reference in New Issue
Block a user