PyUtilib / pyutilib

A collection of general Python utilities, including logging and file IO, subprocess management, plugin systems, and workflow management.
BSD 3-Clause "New" or "Revised" License
34 stars 21 forks source link

Adding the ability to start/stop the TicTocTimer #63

Closed jsiirola closed 4 years ago

jsiirola commented 5 years ago

Fixes: N/A

Summary/Motivation:

This adds the ability to start/stop a TicTicTimer. If the timer was stopped and restarted, then the logged message will also include the number of times the timer was explicitly started.

Changes proposed in this PR:

Legal Acknowledgement

By contributing to this software project, I agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.
coveralls commented 5 years ago

Coverage Status

Coverage decreased (-0.2%) to 62.127% when pulling ba9fd592b75badc0d06a33fc3bc8b4283ac82ddd on timer-start-stop into 3f67b2653329d272d5c1199afe0eec4b13022c9e on master.

jsiirola commented 5 years ago

@michaelbynum: Yes. You can use toc(). It returns the time it prints, and if you set up the timer to be a cumulative timer, then the time that is returned is the current cumulative time. If you want to get the time without actually printing anything, then toc("") will do what you want.