forked from china-testing/python-api-tesing
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtime_clock.py
More file actions
22 lines (19 loc) · 476 Bytes
/
time_clock.py
File metadata and controls
22 lines (19 loc) · 476 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2008 Doug Hellmann All rights reserved.
#
"""The difference between clock and time.
"""
#end_pymotw_header
import hashlib
import time
# Data to use to calculate md5 checksums
data = open(__file__, 'rb').read()
for i in range(5):
h = hashlib.sha1()
print(time.ctime(), ': {:0.3f} {:0.3f}'.format(
time.time(), time.clock()))
for i in range(300000):
h.update(data)
cksum = h.digest()