- data_time += total_seconds
-
- sstart = datetime.now()
- skin.render_image("output/%d.png" % player_id)
- sstop = datetime.now()
- td = sstop-sstart
+ print "Query took %.2f seconds" % (total_seconds)
+
+ print "Creating badges for %d players ..." % len(players)
+ start = datetime.now()
+ data_time, render_time = 0,0
+ for player_id in players:
+ req.matchdict['id'] = player_id
+
+ sstart = datetime.now()
+ skin.get_data(player_id)
+ sstop = datetime.now()
+ td = sstop-sstart
+ total_seconds = (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6
+ data_time += total_seconds
+
+ sstart = datetime.now()
+ skin.render_image("output/%d.png" % player_id)
+ sstop = datetime.now()
+ td = sstop-sstart
+ total_seconds = (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) / 10**6
+ render_time += total_seconds
+
+ stop = datetime.now()
+ td = stop-start