aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2019-05-16 20:44:46 -0300
committerSilvio Rhatto <rhatto@riseup.net>2019-05-16 20:44:46 -0300
commit240dd14b69286e1143263ba749179f1e9b371e89 (patch)
treedb35f95d790a4821f2757bd70cee0004c50fd406
parente5b7b3a23a7b9042fb3db2cec4c6142ebd492fd2 (diff)
downloadckandumper-240dd14b69286e1143263ba749179f1e9b371e89.tar.gz
ckandumper-240dd14b69286e1143263ba749179f1e9b371e89.tar.bz2
Track program time
-rwxr-xr-xckandumper10
1 files changed, 10 insertions, 0 deletions
diff --git a/ckandumper b/ckandumper
index 50669a0..0fc2ff6 100755
--- a/ckandumper
+++ b/ckandumper
@@ -19,6 +19,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Dependencies
+import time
import datetime
import random
import asyncio
@@ -225,6 +226,8 @@ class CkanDumper:
group_list = self.dest + os.sep + 'group_list.json'
tag_list = self.dest + os.sep + 'tag_list.json'
+ print('Starting at ' + str(datetime.datetime.now()))
+
#
# Groups
#
@@ -337,8 +340,15 @@ if __name__ == "__main__":
# Dispatch
try:
+ start_time = time.time()
+
ckan = CkanDumper(args)
ckan.dump()
+
+ interval = round(time.time() - start_time)
+ duration = str(datetime.timedelta(seconds=interval))
+
+ print(f'Done. Elapsed time: {duration}')
except FileNotFoundError as e:
print(e)
exit(1)