How to print clock time using template and format in Python

1 Answer

0 votes
import time

template = '{} -- {:0.2f} -- {:0.2f}'
 
print(template.format(time.ctime(), time.time(), time.clock()))
      
      
         
'''
run:

Sun Jun  2 18:43:21 2019 -- 1559501001.59 -- 0.03
            
'''

 



answered Jun 2, 2019 by avibootz

Related questions

1 answer 163 views
1 answer 189 views
1 answer 160 views
2 answers 158 views
1 answer 121 views
...