Print training time at end of training
188452
def on_train_end(self, logs):
        
        duration = timeit.default_timer() - self.train_start
        print('done, took {:.3f} seconds'.format(duration))
976902
def timed_display(msg):
    
    def print_header(msg, newline=True):
        """Print a header line.

        Args:
            msg: A message to be printed in the center of the header line.
            newline: Whether or not to print a newline at the end of the
                header. This can be convenient for allowing the line to
                overwrite another.
        """
        if sys.stdout.isatty():
            print('\r', end=Style.BRIGHT + Fore.BLUE)
        print(' {} '.format(msg).center(_ncols(), '='),
              end='\n{}'.format(Style.RESET_ALL)
              if newline else Style.RESET_ALL)
        sys.stdout.flush()

    def print_message(msg):
        """Print a task title message.

        Args:
            msg: The message to display before running the task.
        """
        if sys.stdout.isatty():
            print('\r', end='')
            msg = msg.ljust(_ncols())
        print(msg, end='')
        sys.stdout.flush()

    start = time.time()
    print_header(msg)
    with hidden_cursor():
        try:
            yield print_message
        finally:
            delta = time.time() - start
            print_header('completed in {:.2f}s'.format(delta), False)
377341
def ctime(message=None):
    ""
    global t_elapsed
    t_elapsed = 0.0
    print('\n')
    t = time.time()
    yield
    if message:
        print(message + ":  ", end='')
    t_elapsed = time.time() - t
    print(round(t_elapsed, 4), "sec")
320238
private static void printStartStopTimes() {
        final long start = System.currentTimeMillis();

        System.err.println("Start at " + new Date());

        Thread hook = new Thread() {
            @Override
            public void run() {
                long timePassed = System.currentTimeMillis() - start;
                System.err.println("Stop at " + new Date() + ", execution time = " + timePassed + " ms");
            }
        };
        Runtime.getRuntime().addShutdownHook(hook);
    }
35633
def _maybe_print(something_to_print, end=None, min_=1, max_=99, verbose=0):
    """"""
    if min_ <= verbose <= max_:
        import sys
        print(something_to_print, end=end)
        sys.stdout.flush()
240055
def doit(self):
        """"""
        idx_start, idx_end = self.simindices
        self.open_files(idx_start)
        methodorder = self.methodorder
        for idx in printtools.progressbar(range(idx_start, idx_end)):
            for func in methodorder:
                func(idx)
        self.close_files()
1025009
def reportTimes(self):
        

        self.end = _ptime()
        total_time = 0
        print(ProcSteps.__report_header)
        for step in self.order:
            if 'elapsed' in self.steps[step]:
                _time = self.steps[step]['elapsed']
            else:
                _time = 0.0
            total_time += _time
            print('   %20s          %0.4f sec.' % (step, _time))

        print('   %20s          %s' % ('=' * 20, '=' * 20))
        print('   %20s          %0.4f sec.' % ('Total', total_time))
1363481
def timeit(output):
    
    b = time.time()
    yield
    print output, 'time used: %.3fs' % (time.time()-b)
760746
def print_infos(results):
    
    print('transactions: %i' % results.total_transactions)
    print('timers: %i' % results.total_timers)
    print('errors: %i' % results.total_errors)
    print('test start: %s' % results.start_datetime)
    print('test finish: %s\n' % results.finish_datetime)
62002
public synchronized void printStatistics() {
        // quickly memoize and update counters, get the time, record update time, etc...
        long nowSuccesses = incrementCount.get();
        long nowFailures = failureCount.get();
        long prevSuccesss = lastPeriod.getAndSet(nowSuccesses);
        long endTime = System.currentTimeMillis();
        long startTime = lastStatsReportTS;
        lastStatsReportTS = endTime;

        // do math with as much safety as possible
        long invocationsCompleted = Math.max(nowSuccesses - prevSuccesss, 0);
        long periodDurationMs = Math.max(endTime - startTime, 1);
        long cumulativeDurationMs = Math.max(endTime - benchmarkStartTS, 1);
        long periodThroughput = (long) (invocationsCompleted / (periodDurationMs / 1000.0));
        long cumulativeThroughput = (long) (nowSuccesses / (cumulativeDurationMs / 1000.0));
        long time = (long) (Math.round(endTime - benchmarkStartTS) / 1000.0);

        // print out periodic report
        System.out.printf("%02d:%02d:%02d ", time / 3600, (time / 60) % 60, time % 60);
        System.out.printf("Period Throughput %10d/s, ", periodThroughput);
        System.out.printf("Cumulative Throughput %10d/s, ", cumulativeThroughput);
        System.out.printf("Total Failures %10d", nowFailures);
        System.out.printf("\n");
    }
639033
function print() {
        var parts = String(out).split('\n');
        /* istanbul ignore next */
        if (parts.length > 1) {
          out = parts.pop();
          var logging = String(parts.join('\n')).replace(/\r\r/g, '\r');
          slf.log(logging);
        }
        /* istanbul ignore next */
        if (closed === false) {
          setTimeout(function () {
            print();
          }, 50);
        }
      }
376463
def on_batch_end(self, train, **kwargs:Any)->None:
        ""
        if train:
            if self.idx_s >= len(self.scheds): return {'stop_training': True, 'stop_epoch': True}
            sched = self.scheds[self.idx_s]
            for k,v in sched.items(): self.opt.set_stat(k, v.step())
            if list(sched.values())[0].is_done: self.idx_s += 1
1205018
def pprint(self, seconds):
        
        return ("%d:%02d:%02d.%03d", reduce(lambda ll, b: divmod(ll[0], b) + ll[1:], [(seconds * 1000,), 1000, 60, 60]))
634083
def _print_duration(self):
        ''''''
        duration = int(time.time() - self._start_time)
        self._print(datetime.timedelta(seconds=duration))
1321776
def pprint(self, num=10):
        
        def takeAndPrint(time, rdd):
            taken = rdd.take(num + 1)
            print("-------------------------------------------")
            print("Time: %s" % time)
            print("-------------------------------------------")
            for record in taken[:num]:
                print(record)
            if len(taken) > num:
                print("...")
            print("")

        self.foreachRDD(takeAndPrint)
905507
def print_long(filename, stat, print_func):
    """"""
    size = stat_size(stat)
    mtime = stat_mtime(stat)
    file_mtime = time.localtime(mtime)
    curr_time = time.time()
    if mtime > (curr_time + SIX_MONTHS) or mtime < (curr_time - SIX_MONTHS):
        print_func('%6d %s %2d %04d  %s' % (size, MONTH[file_mtime[1]],
                                            file_mtime[2], file_mtime[0],
                                            decorated_filename(filename, stat)))
    else:
        print_func('%6d %s %2d %02d:%02d %s' % (size, MONTH[file_mtime[1]],
                                                file_mtime[2], file_mtime[3], file_mtime[4],
                                                decorated_filename(filename, stat)))
408777
def print_result_from_timeit(stmt='pass', setup='pass', number=1000000):
    
    units = ["s", "ms", "us", "ns"]
    duration = timeit(stmt, setup, number=int(number))
    avg_duration = duration / float(number)
    thousands = int(math.floor(math.log(avg_duration, 1000)))

    print("Total time: %fs. Average run: %.3f%s." % (
        duration, avg_duration * (1000 ** -thousands), units[-thousands]))