uysalibov / perfov

A simple Python class for measuring performance of processes.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Perfov

A simple Python class for measuring performance of processes.

Installation

pip install perfov

Usage

Here's an example of how you can use Perfov in your code:

from perfov import Perfov

perfov = Perfov()
perfov.start()
perfov.checkpoint(label="Rendering")
perfov.checkpoint(label="Burning")
perfov.finish()

The above code will output the following results:

Performance Results:
Rendering: 0.12 seconds
Burning: 0.23 seconds
Total time: 0.35 seconds

Methods

Perfov has the following methods:

  • start(): Mark the start time of the performance measurement.

  • checkpoint(label): Create a checkpoint for a specific process, where label is a string that describes the process.

  • finish(): Print the total elapsed time for all processes.

License

This project is licensed under the MIT License.

About

A simple Python class for measuring performance of processes.

License:MIT License


Languages

Language:Python 100.0%