Files
local_function/example/chrono.py
Lorenzo Caminiti 28aaeb01fa Added LocalFunction examples.
[SVN r77021]
2012-02-15 00:35:55 +00:00

23 lines
505 B
Python
Executable File

# Copyright (C) 2009-2012 Lorenzo Caminiti
# Distributed under the Boost Software License, Version 1.0
# (see accompanying file LICENSE_1_0.txt or a copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Home at http://www.boost.org/libs/local_function
import sys
import time
import os
# Usage: python crono.py COMMAND [COMMAND_OPTIONS]
cmd = ""
for arg in sys.argv[1:]: cmd += str(arg) + " "
start = time.time()
ret = os.system(cmd)
sec = time.time() - start
if (ret == 0): print "\n" + str(sec) + "s"