summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Langille <dvl@FreeBSD.org>2020-06-29 19:11:36 +0000
committerDan Langille <dvl@FreeBSD.org>2020-06-29 19:11:36 +0000
commitc440f3b05bfc7a5e68286d87432032d98f03b1bc (patch)
tree37660323829fd4621fcd67a5a74b7fa7a295f289
parentgraphics/blender: Update to 2.83.1 (diff)
Add py-ttictoc
Tools for timing python code. PR: 247354 Submitted by: Gilbert Morgan <gmm@tutanota.com>
Notes
Notes: svn path=/head/; revision=540825
-rw-r--r--devel/Makefile1
-rw-r--r--devel/py-ttictoc/Makefile22
-rw-r--r--devel/py-ttictoc/distinfo3
-rw-r--r--devel/py-ttictoc/pkg-descr14
4 files changed, 40 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile
index a827e995cedc..a866e10949bd 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -5146,6 +5146,7 @@
SUBDIR += py-tree-format
SUBDIR += py-trimesh
SUBDIR += py-trollius
+ SUBDIR += py-ttictoc
SUBDIR += py-ttystatus
SUBDIR += py-tvrage
SUBDIR += py-tw.forms
diff --git a/devel/py-ttictoc/Makefile b/devel/py-ttictoc/Makefile
new file mode 100644
index 000000000000..c37500cddfde
--- /dev/null
+++ b/devel/py-ttictoc/Makefile
@@ -0,0 +1,22 @@
+# $FreeBSD$
+
+PORTNAME= ttictoc
+PORTVERSION= 0.5.6
+CATEGORIES= devel
+MASTER_SITES= CHEESESHOP
+PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
+
+MAINTAINER= gmm@tutanota.com
+COMMENT= Time execution of blocks of code
+
+LICENSE= MIT
+LICENSE_FILE= ${WRKSRC}/LICENSE
+
+RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}black>0:devel/py-black@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR} \
+ ${PYTHON_PKGNAMEPREFIX}flake8>0:devel/py-flake8@${PY_FLAVOR}
+
+USES= localbase python
+USE_PYTHON= autoplist distutils
+
+.include <bsd.port.mk>
diff --git a/devel/py-ttictoc/distinfo b/devel/py-ttictoc/distinfo
new file mode 100644
index 000000000000..6dfb46ff72d8
--- /dev/null
+++ b/devel/py-ttictoc/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1592422035
+SHA256 (ttictoc-0.5.6.tar.gz) = 9ae0a534faf299b13f7d71693f8f97b28069932e2583effec799b7e8bf1964d9
+SIZE (ttictoc-0.5.6.tar.gz) = 4385
diff --git a/devel/py-ttictoc/pkg-descr b/devel/py-ttictoc/pkg-descr
new file mode 100644
index 000000000000..b72eb0fcbcb0
--- /dev/null
+++ b/devel/py-ttictoc/pkg-descr
@@ -0,0 +1,14 @@
+Time execution of blocks of code.
+
+Tested against python 3.6+, but should work with other versions.
+
+The easiest way to time something is with tic and toc:
+
+import time
+from ttictoc import tic,toc
+tic()
+time.sleep(1)
+elapsed = toc()
+print('Elapsed time:',elapsed)
+
+WWW: https://github.com/hector-sab/ttictoc