Convert a time units to seconds
Project description
Convert_ms
- Use this package for converting units of time to seconds.
What is it?
from convert_ms import ms, check
ms("1m") # return 60
ms("1h") # return 3600
ms("1d") # return 86400
check("1m") # return True
check("1o") # return False
How to use ?
from convert_ms import ms, check
import asyncio
duration = "1h"
if check(query=duration):
await asyncio.sleep(ms(query=duration))
else:
print("you have entered a non-existent unit of time")
Formats
seconds, secs, s, m, min, minute, h, hour, d, day, w, week, mon, month, y, year
Find a bug?
Report here
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
convert_ms-0.0.5.tar.gz
(2.1 kB
view hashes)
Built Distribution
Close
Hashes for convert_ms-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9747b87ebb51db5af327052996a056c7392dffb7dcd0f344ab2121f88af93a04 |
|
MD5 | 1283b43cbb43e71781603c043a6271f2 |
|
BLAKE2b-256 | c7a6ac751b9e3b597b124d2246650a0caa10d2bb7d073d4b7f8d2aa3f5b2bbad |