You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

small-timer

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

small-timer

A miniature timer that does the same thing as a regular timer

1.0.9
pipPyPI
Maintainers
1

Timer

Small timer that can do parallel computing

Installation

pip install small-timer

Documentation

  • timer_point(time: Any, repeat:bool = False)
    • time in seconds
    • This function start timer
  • check_timer() -> bool
    • This function check
    • Was timer fished
  • check_time() -> list
    • This function check
    • How much time is left
    • check_time()[0] - minutes
    • check_time()[1] - seconds
  • restart()
    • This function restart timer

Usage

  • Import class Timer:
    from small_timer import Timer
    
  • Create object timer:
    timer = Timer()
    
  • Create timer and start it:
    timer.timer_point(10)
    
  • Check timer if timer finished:
    if timer.check_timer():
        print("Timer finished!!!")
    else:
        print("Timer didn't finish")
    

Example code

from small_timer import Timer

timer = Timer()
timer.timer_point(10)

while 1:
    if timer.check_timer():
       print("Timer finished!!!")
       break
    else:
       print("Timer didn't finish")
       print(f"{timer.check_time()[0]}:{timer.check_time()[1]}")
       print()

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts