Need to find the difference between the two times, how do I do this?

Do I use the date/time module?

My goal is to calculate the averages of multiple time duration. I am thinking for storing them in a list and later need to calculate the average. For the averaging, should I convert to seconds and then average? Nov 29, 2018 in Python
edited Dec 11, 2018 237 views

## 1 answer to this question.

Try doing this - It is efficient for timing short-term events.

```import time
start = time.time()

time.sleep(10)  # or anything

done = time.time()
elapsed = done - start
print(elapsed)``` answered Nov 29, 2018 by
• 3,520 points

edited Dec 11, 2018 by Nymeria

## how to compare two strings in python?

compare two string in python >>> s1="abc ...READ MORE

## How to calculate square root of a number in python?

calculate square root in python >>> import math ...READ MORE

## How to get the current time in Python

FOLLOWING WAY TO FIND CURRENT TIME IN ...READ MORE

## How to get the current time in Python

>>> import datetime >>> datetime.datetime.now() datetime(2018, 25, ...READ MORE

+1 vote

## how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

## how do i use the enumerate function inside a list?

can you give an example using a ...READ MORE

## Lowercase in Python

You can simply the built-in function in ...READ MORE