How to use the hanlp.utils.time_util.report_time_delta function in hanlp

To help you get started, we’ve selected a few hanlp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hankcs / HanLP / hanlp / utils / io_util.py View on Github external
return
                duration = time.time() - start_time
                duration = max(1e-8, duration)
                progress_size = int(count * block_size)
                if progress_size > total_size:
                    progress_size = total_size
                speed = int(progress_size / duration)
                ratio = progress_size / total_size
                ratio = max(1e-8, ratio)
                percent = ratio * 100
                eta = duration / ratio * (1 - ratio)
                speed = human_bytes(speed)
                progress_size = human_bytes(progress_size)
                sys.stderr.write("\r%.2f%%, %s/%s, %s/s, ETA %s      " %
                                 (percent, progress_size, human_bytes(total_size), speed,
                                  time_util.report_time_delta(eta)))
                sys.stderr.flush()