????

Your IP : 18.119.110.152


Current Path : /lib/python3.6/site-packages/glances/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/glances/__pycache__/timer.cpython-36.opt-1.pyc

3

Eo�c7�@sLdZddlmZddlmZiadd�ZGdd�de�ZGdd	�d	e�Zd
S)zThe timer manager.�)�time)�datetimecCs.t�}tj|�}|sd}n||}|t|<|S)z*Return the elapsed time since last update.�)r�last_update_times�get)ZIOTypeZcurrent_timeZ	last_timeZtime_since_update�r�/usr/lib/python3.6/timer.py�getTimeSinceLastUpdates
r	c@sBeZdZdZdd�Zdd�Zddd�Zd	d
�Zdd�Zd
d�Z	dS)�Timerz&The timer class. A simple chronometer.cCs||_|j�dS)N)�duration�start)�selfrrrr�__init__%szTimer.__init__cCst�|j|_dS)N)rr�target)r
rrrr)szTimer.startNcCs|dk	r|j|�|j�dS)N)�setr)r
rrrr�reset,s
zTimer.resetcCs|j|jt�S)N)rrr)r
rrrr1sz	Timer.getcCs
||_dS)N)r)r
rrrrr4sz	Timer.setcCst�|jkS)N)rr)r
rrr�finished7szTimer.finished)N)
�__name__�
__module__�__qualname__�__doc__rrrrrrrrrrr
!s
r
c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�CounterzThe counter class.cCs|j�dS)N)r)r
rrrr?szCounter.__init__cCstj�|_dS)N)r�nowr)r
rrrrBsz
Counter.startcCs|j�dS)N)r)r
rrrrEsz
Counter.resetcCstj�|jj�S)N)rrrZ
total_seconds)r
rrrrHszCounter.getN)rrrrrrrrrrrrr;s
rN)rrrrr	�objectr
rrrrr�<module>
s