repo.or.cz
/
faces-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Added TODO and DEVELOPMENT.
[faces-project.git]
/
metapie
/
timeit.py
blob
b1ed690878ae4e3b6a6abbce643d0aba828c94f3
1
import
time
2
3
class
TimeIt
(
object
):
4
"""
5
Miniprofiling
6
"""
7
def
__init__
(
self
,
name
):
8
self
._
sumtime
=
0
9
self
._
count
=
0
10
self
._
name
=
name
11
12
def
start
(
self
):
13
self
._
start
=
time
.
clock
()
14
15
def
end
(
self
):
16
end
=
time
.
clock
()
17
self
._
sumtime
+=
end
-
self
._
start
18
self
._
count
+=
1
19
print
"time_it"
,
self
._
name
,
end
-
self
._
start
,
\
20
self
._
sumtime
/
self
._
count
21