The time module in Python provides various time-related functions. Here’s how you can use it:
First, you have to import the time module using the following code:
```
import time
```
1. Getting the current time:
```
current_time = time.time()
print(current_time)
```
The `time()` function returns the number of seconds passed since epoch. For Unix system, January 1, 1970, 00:00:00 at UTC is epoch (the point where time begins).
1. Converting a time expressed in seconds since the epoch to a struct\_time in UTC:
```
current_structure_time = time.gmtime()
print(current_structure_time)
```
1. Local time:
```
local_time = time.localtime()
print(local_time)
```
The `localtime()` function takes the number of seconds passed since epoch as an argument and returns struct\_time in local time.
1. Formatting time:
```
formatted_time = time.asctime(time.localtime())
print(formatted_time)
```
The `asctime()` function takes struct\_time (or a tuple representing it) as an argument and returns a string representing it.
1. Creating a timer:
```
start = time.time()
1. Sleep:
The `sleep()` function suspends (delays) execution of the current thread for the given number of seconds.
```
print(“This is printed immediately.”)
time.sleep(2.4)
print(“This is printed after 2.4 seconds.”)
```
Remember, the time module in Python mainly deals with seconds since epoch.