Rizin
unix-like reverse engineering framework and cli tools
|
Time handling functions. More...
Go to the source code of this file.
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 |
Time handling functions.
Definition in file mytime.c.
uint64_t mytime_get_elapsed | ( | void | ) |
Get the number of milliseconds since the operation started.
Definition at line 59 of file mytime.c.
References mytime_now(), and start_time.
Referenced by message_progress_update(), and progress_flush().
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().
Definition at line 74 of file mytime.c.
References int, INT_MAX, MODE_COMPRESS, mytime_now(), next_flush, opt_flush_timeout, and opt_mode.
Referenced by io_read().
|
static |
Get the current time as milliseconds.
It's relative to some point but not necessarily to the UNIX Epoch.
Definition at line 29 of file mytime.c.
References gettimeofday, NULL, and tv.
Referenced by mytime_get_elapsed(), mytime_get_flush_timeout(), mytime_set_flush_time(), and mytime_set_start_time().
void mytime_set_flush_time | ( | void | ) |
Store the time of when compressor was flushed.
Definition at line 66 of file mytime.c.
References mytime_now(), next_flush, and opt_flush_timeout.
Referenced by io_read().
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.
Definition at line 51 of file mytime.c.
References mytime_now(), and start_time.
Referenced by coder_run().
|
static |
Definition at line 22 of file mytime.c.
Referenced by mytime_get_flush_timeout(), and mytime_set_flush_time().
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.
Definition at line 19 of file mytime.c.
Referenced by coder_init(), mytime_get_flush_timeout(), mytime_set_flush_time(), and parse_real().
|
static |
Definition at line 21 of file mytime.c.
Referenced by mytime_get_elapsed(), mytime_set_start_time(), and rz_test_run_test().