Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: added tic, tac, toc functions #83

Merged
merged 2 commits into from
Oct 16, 2014
Merged

ENH: added tic, tac, toc functions #83

merged 2 commits into from
Oct 16, 2014

Conversation

albop
Copy link
Contributor

@albop albop commented Oct 16, 2014

I always lack the tic, toc functions from matlab. Here is a trivial implementation. It works exactly like Matlab's version, has an additional tac() function.
Here is an example:

from quantecon.timing import tic,tac,toc

tic()  # initializes timer
for i in range(10):
    sleep(1)
    tac()   # prints: "Elapsed: 1 seconds."
toc() # prints: "Elapsed: 10 seconds."

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) when pulling d271a1c on albop:timing into f23a4b5 on QuantEcon:master.

@sglyon
Copy link
Member

sglyon commented Oct 16, 2014

This is cool, thanks for sharing.

@sglyon
Copy link
Member

sglyon commented Oct 16, 2014

One comment about the code is that we are really pushing numpydoc style docstrings. The only place I see in your code that could be changed to conform to that is in the main doctoring for the Timer class.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) when pulling c4d2ea0 on albop:timing into f23a4b5 on QuantEcon:master.

@albop
Copy link
Contributor Author

albop commented Oct 16, 2014

I fixed the docstring. Note that the object is not supposed to be used by
end users though. It should not be seen in generated documentation.

On Thu, Oct 16, 2014 at 2:45 PM, Coveralls [email protected] wrote:

[image: Coverage Status] https://coveralls.io/builds/1345314

Coverage increased (+0.03%) when pulling c4d2ea0
c4d2ea0
on albop:timing
into f23a4b5
f23a4b5
on QuantEcon:master
.


Reply to this email directly or view it on GitHub
#83 (comment).

jstac added a commit that referenced this pull request Oct 16, 2014
ENH: added tic, tac, toc functions
@jstac jstac merged commit 9e62b84 into QuantEcon:master Oct 16, 2014
@jstac
Copy link
Contributor

jstac commented Oct 16, 2014

Thanks, this is neat. It might be appreciated by MATLAB refugees.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants