Skip to content

qweeze/lineprof

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lineprof

A simplified version of Robert Kern's line profiler

Usage

usage: lineprof.py [-h] [-m] [-o OUTPUT] [--include INCLUDE] prog ...

Line profiler

positional arguments:
  prog                  A script to profile
  args                  Arguments for a script

optional arguments:
  -h, --help            show this help message and exit
  -m                    Profile a module
  -o OUTPUT, --output OUTPUT
                        Write output to file
  --include INCLUDE     File(s) to trace (glob is supported)

Example

Code:
import time


def func(x):
    time.sleep(x)


def main():
    for x in [0.1, 0.2, 0.3]:
        func(x)

    time.sleep(0.5)


if __name__ == '__main__':
    main()
Output:

screenshot