XZ Utils 5.3.5beta
Functions | Variables
mytime.c File Reference

Time handling functions. More...

#include "private.h"
#include <sys/time.h>

Functions

static uint64_t mytime_now (void)
 Get the current time as milliseconds. More...
 
void mytime_set_start_time (void)
 Store the time when (de)compression was started. More...
 
uint64_t mytime_get_elapsed (void)
 Get the number of milliseconds since the operation started. More...
 
void mytime_set_flush_time (void)
 Store the time of when compressor was flushed. More...
 
int mytime_get_flush_timeout (void)
 Get the number of milliseconds until the next flush. More...
 

Variables

uint64_t opt_flush_timeout = 0
 Number of milliseconds to between LZMA_SYNC_FLUSHes. More...
 
static uint64_t start_time
 
static uint64_t next_flush
 

Detailed Description

Time handling functions.

Function Documentation

◆ mytime_now()

static uint64_t mytime_now ( void  )
static

Get the current time as milliseconds.

It's relative to some point but not necessarily to the UNIX Epoch.

Referenced by mytime_get_elapsed().

◆ mytime_set_start_time()

void mytime_set_start_time ( void  )

Store the time when (de)compression was started.

The start time is also stored as the time of the first flush.

◆ mytime_get_elapsed()

uint64_t mytime_get_elapsed ( void  )

Get the number of milliseconds since the operation started.

References mytime_now().

Referenced by message_progress_update().

◆ mytime_set_flush_time()

void mytime_set_flush_time ( void  )

Store the time of when compressor was flushed.

◆ mytime_get_flush_timeout()

int mytime_get_flush_timeout ( void  )

Get the number of milliseconds until the next flush.

This returns -1 if no timed flushing is used.

The return value is intended for use with poll().

References opt_flush_timeout, and opt_mode.

Variable Documentation

◆ opt_flush_timeout

uint64_t opt_flush_timeout = 0

Number of milliseconds to between LZMA_SYNC_FLUSHes.

If 0, timed flushing is disabled. Otherwise if no more input is available and not at the end of the file and at least opt_flush_timeout milliseconds has elapsed since the start of compression or the previous flushing (LZMA_SYNC_FLUSH or LZMA_FULL_FLUSH), set LZMA_SYNC_FLUSH to flush the pending data.

Referenced by mytime_get_flush_timeout().