'Prints the timing of each task and total time to
run the complete playbook'

def playbook_on_stats(self, stats):

    if (self.current_task is not None):
        self.stats[self.current_task][(-1)].stop()
    self.playbook_timestamp.stop()
    flat_stats = {}
    for (task_name, task_runs) in self.stats.iteritems():
        if (len(task_runs) == 1):
            flat_stats[task_name] = task_runs[0]
        else:
            for (i, run) in enumerate(task_runs):
                run_name = '{}    [{}]'.format(task_name, i)
                flat_stats[run_name] = run
    for logger in self.loggers:
        logger.log_play(self.playbook_name, self.playbook_timestamp, flat_stats)
