CI: update FreeBSD, NetBSD, OpenBSD, Solaris actions
[xz.git] / src / xz / mytime.h
blob6dfaeae9b683fbcf517ca6386eb6ef1579be5c27
1 // SPDX-License-Identifier: 0BSD
3 ///////////////////////////////////////////////////////////////////////////////
4 //
5 /// \file mytime.h
6 /// \brief Time handling functions
7 //
8 // Author: Lasse Collin
9 //
10 ///////////////////////////////////////////////////////////////////////////////
13 /// \brief Number of milliseconds to between LZMA_SYNC_FLUSHes
14 ///
15 /// If 0, timed flushing is disabled. Otherwise if no more input is available
16 /// and not at the end of the file and at least opt_flush_timeout milliseconds
17 /// has elapsed since the start of compression or the previous flushing
18 /// (LZMA_SYNC_FLUSH or LZMA_FULL_FLUSH), set LZMA_SYNC_FLUSH to flush
19 /// the pending data.
20 extern uint64_t opt_flush_timeout;
23 #ifdef USE_SIGTSTP_HANDLER
24 /// \brief Signal handler for SIGTSTP
25 extern void mytime_sigtstp_handler(int sig);
26 #endif
29 /// \brief Store the time when (de)compression was started
30 ///
31 /// The start time is also stored as the time of the first flush.
32 extern void mytime_set_start_time(void);
35 /// \brief Get the number of milliseconds since the operation started
36 extern uint64_t mytime_get_elapsed(void);
39 /// \brief Store the time of when compressor was flushed
40 extern void mytime_set_flush_time(void);
43 /// \brief Get the number of milliseconds until the next flush
44 ///
45 /// This returns -1 if no timed flushing is used.
46 ///
47 /// The return value is intended for use with poll().
48 extern int mytime_get_flush_timeout(void);