Write any 3-python run domains
Answers
Answered by
0
Answer:
Try this:
import time
t_end = time.time() + 60 * 15
while time.time() < t_end:
# do whatever you do
This will run for 15 min x 60 s = 900 seconds.
Function time.time returns the current time in seconds since 1st Jan 1970. The value is in floating point, so you can even use it with sub-second precision. In the beginning the value t_end is calculated to be "now" + 15 minutes. The loop will run until the current time exceeds this preset ending time.
Similar questions
Social Sciences,
4 months ago
Math,
4 months ago
India Languages,
8 months ago
Hindi,
8 months ago
Biology,
1 year ago