Skip to content

luciencho/lctimer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LucienTimer

A package for timer the duplicated python codes.

Installation

$ pip install lctimer

Usage

from lctimer import timer

@timer.record
def foo():
    a = 0
    for _ in range(100000):
            a += 1


@timer.record
class B:

    def __init__(self):
            self.words = 'testing'

    @staticmethod
    def ioo():
            c = 0
            for _ in range(100000):
                    c += 1
    c = 0


if __name__ == '__main__':
    for _ in range(5):
            foo()
            B.ioo()

    timer.sum_up()
    # Function: "ioo"       Best: 4.01 ms   Average: 4.81 ms        Worst: 5.04 ms  Total Loops: 5
    # Function: "foo"       Best: 4.01 ms   Average: 4.42 ms        Worst: 5.04 ms  Total Loops: 5

About

A package for timer python codes.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages