Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
code_block_timer
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
code_block_timer
Commits
014a30e5
Commit
014a30e5
authored
Dec 16, 2014
by
John Eskew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
global in methods
parent
580a827b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
code_block_timer/__init__.py
+2
-0
No files found.
code_block_timer/__init__.py
View file @
014a30e5
...
@@ -21,6 +21,7 @@ class CodeBlockTimer(object):
...
@@ -21,6 +21,7 @@ class CodeBlockTimer(object):
self
.
run_id
=
None
self
.
run_id
=
None
def
__enter__
(
self
):
def
__enter__
(
self
):
global
__m
if
__m
.
nest_level
==
0
:
if
__m
.
nest_level
==
0
:
self
.
run_id
=
self
.
data_store
.
run_id
()
self
.
run_id
=
self
.
data_store
.
run_id
()
__m
.
nest_level
+=
1
__m
.
nest_level
+=
1
...
@@ -28,6 +29,7 @@ class CodeBlockTimer(object):
...
@@ -28,6 +29,7 @@ class CodeBlockTimer(object):
return
self
return
self
def
__exit__
(
self
,
*
args
):
def
__exit__
(
self
,
*
args
):
global
__m
end
=
self
.
timer
()
end
=
self
.
timer
()
self
.
elapsed_secs
=
end
-
self
.
start
self
.
elapsed_secs
=
end
-
self
.
start
self
.
elapsed
=
self
.
elapsed_secs
*
1000
# millisecs
self
.
elapsed
=
self
.
elapsed_secs
*
1000
# millisecs
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment