Benchmarking
Marcos Sánchez Provencio
rapto en arrakis.es
Jue Ago 24 15:25:11 CEST 2006
El mié, 23-08-2006 a las 13:23 +0200, David Arango escribió:
> Hola a todos de nuevo :-),
>
> ¿Conocéis algún componente (clase, módulo...) que pueda reutilizar
> para hacer benchmarking? No tiene que ser nada muy sofisticado, con
> que permita medir tiempos antes y después de una tarea y luego
> exportar el resultado de alguna manera me sirve.
>
> Gracias
Mira timeit
NAME
timeit - Tool for measuring execution time of small code snippets.
FILE
/usr/lib/python2.4/timeit.py
MODULE DOCS
http://www.python.org/doc/current/lib/module-timeit.html
DESCRIPTION
This module avoids a number of common traps for measuring execution
times. See also Tim Peters' introduction to the Algorithms chapter
in
the Python Cookbook, published by O'Reilly.
Library usage: see the Timer class.
Command line usage:
python timeit.py [-n N] [-r N] [-s S] [-t] [-c] [-h] [statement]
Options:
-n/--number N: how many times to execute 'statement' (default: see
below)
-r/--repeat N: how many times to repeat the timer (default 3)
-s/--setup S: statement to be executed once initially (default
'pass')
-t/--time: use time.time() (default on Unix)
-c/--clock: use time.clock() (default on Windows)
-v/--verbose: print raw timing results; repeat for more digits
precision
-h/--help: print this usage message and exit
statement: statement to be timed (default 'pass')
------------ próxima parte ------------
_______________________________________________
Python-es mailing list
Python-es en aditel.org
http://listas.aditel.org/listinfo/python-es
Más información sobre la lista de distribución Python-es