mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 15:56:07 -07:00
Bump tempora from 5.2.1 to 5.5.0 (#2111)
* Bump tempora from 5.2.1 to 5.5.0 Bumps [tempora](https://github.com/jaraco/tempora) from 5.2.1 to 5.5.0. - [Release notes](https://github.com/jaraco/tempora/releases) - [Changelog](https://github.com/jaraco/tempora/blob/main/NEWS.rst) - [Commits](https://github.com/jaraco/tempora/compare/v5.2.1...v5.5.0) --- updated-dependencies: - dependency-name: tempora dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update tempora==5.5.0 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> [skip ci]
This commit is contained in:
parent
9a196f3dca
commit
1e903b164b
10 changed files with 429 additions and 133 deletions
|
@ -48,20 +48,21 @@ class Stopwatch:
|
|||
def reset(self):
|
||||
self.elapsed = datetime.timedelta(0)
|
||||
with contextlib.suppress(AttributeError):
|
||||
del self.start_time
|
||||
del self._start
|
||||
|
||||
def _diff(self):
|
||||
return datetime.timedelta(seconds=time.monotonic() - self._start)
|
||||
|
||||
def start(self):
|
||||
self.start_time = datetime.datetime.utcnow()
|
||||
self._start = time.monotonic()
|
||||
|
||||
def stop(self):
|
||||
stop_time = datetime.datetime.utcnow()
|
||||
self.elapsed += stop_time - self.start_time
|
||||
del self.start_time
|
||||
self.elapsed += self._diff()
|
||||
del self._start
|
||||
return self.elapsed
|
||||
|
||||
def split(self):
|
||||
local_duration = datetime.datetime.utcnow() - self.start_time
|
||||
return self.elapsed + local_duration
|
||||
return self.elapsed + self._diff()
|
||||
|
||||
# context manager support
|
||||
def __enter__(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue