'Print the time elapsed between the last call and the current
call, with an optional message.'

def __call__(self, msg='', total=False):

    if (not total):
        time_lapse = (time.time() - self.last_time)
        full_msg = ('%s:    %s' % (msg, format_time(time_lapse)))
    else:
        time_lapse = (time.time() - self.start_time)
        full_msg = ('%s:    %.2fs,    %.1f    min' % (msg, time_lapse, (time_lapse / 60)))
    print(full_msg, file=sys.stderr)
    if (self.logfile is not None):
        try:
            with open(self.logfile, 'a') as f:
                print(full_msg, file=f)
        except:
            '    Multiprocessing    writing    to    files    can    create    race\n                                                                                conditions.    Rather    fail    silently    than    crash    the\n                                                                                calculation.\n                                                                '
    self.last_time = time.time()
