-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
hartsantler
committed
Nov 13, 2015
1 parent
67224c0
commit 24b8399
Showing
3 changed files
with
25 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from runtime import * | ||
''' | ||
timeout decorator with loop | ||
''' | ||
|
||
counter = 0 | ||
|
||
def main(): | ||
@timeout(1) | ||
def foo(): | ||
print 'foo' | ||
|
||
@timeout(1, loop=True) | ||
def bar(): | ||
global counter | ||
print 'bar:'+counter | ||
counter += 1 | ||
if counter > 5: | ||
process.exit() | ||
|
||
main() |