SyntaxFix
Write A Post
Hire A Developer
Questions
import time from datetime import datetime t1 = datetime.now().replace(microsecond=0) time.sleep(3) now = datetime.now().replace(microsecond=0) print((now - t1).total_seconds())
result: 3.0