From 8d4e09519e32f0c5b9325fd4c42b5c771120d592 Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Sun, 5 Apr 2015 01:09:08 +0200 Subject: [PATCH] =?utf8?q?[bde/stats/all=5Fpast]=20Affichage=20du=20timing?= =?utf8?q?=20au=20fur=20et=20=C3=A0=20mesure?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- bde/stats/all_past.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bde/stats/all_past.py b/bde/stats/all_past.py index 75f1b1d..20ae663 100755 --- a/bde/stats/all_past.py +++ b/bde/stats/all_past.py @@ -4,6 +4,7 @@ """Pour récupérer les soldes des comptes à plusieurs moments du passé.""" import depenses +import time def get_idbdes(): """Récupère les idbdes de tous les comptes.""" @@ -34,14 +35,15 @@ def get_all(idbdes, verbose=False): data = {} if verbose: print "Dernier idbde : %s" % (max(idbdes),) + tic = time.time() for i in idbdes: data[i] = depenses.get_depenses(i, bymonth=True)[0] - if i % 100 == 0: - if verbose: - print i + if verbose and i % 100 == 0: + print i, time.time() - tic return data if __name__ == "__main__": idbdes = get_idbdes() + idbdes.sort() data = get_all(idbdes, verbose=True) to_csv(data, "all_past.csv") -- 2.39.2