Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion 9 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ $ python -m pip install codetiming

The source code is [available at GitHub](https://github.com/realpython/codetiming).


## Basic Usage

You can use `codetiming.Timer` in several different ways:
Expand Down Expand Up @@ -36,6 +37,7 @@ You can use `codetiming.Timer` in several different ways:
# Do something
```


## Arguments

`Timer` accepts the following arguments when it's created, all are optional:
Expand Down Expand Up @@ -74,4 +76,9 @@ WARNING:root:Time spent: 1.73
{'example': 5.312697440000193}
```

The example shows how you can redirect the timer output to the logging module. Note that the elapsed time spent in the two different uses of `t` has been accumulated in `Timer.timers`.
The example shows how you can redirect the timer output to the logging module. Note that the elapsed time spent in the two different uses of `t` has been accumulated in `Timer.timers`.


## Acknowledgements

`codetiming` is based on a similar module originally developed for the [Midgard Geodesy library](https://kartverket.github.io/midgard/) at the [Norwegian Mapping Authority](https://www.kartverket.no/en/).
Morty Proxy This is a proxified and sanitized view of the page, visit original site.