diff options
author | Michał Łyszczek <michal.lyszczek@bofc.pl> | 2018-04-18 13:44:26 +0200 |
---|---|---|
committer | Michał Łyszczek <michal.lyszczek@bofc.pl> | 2018-04-18 13:44:26 +0200 |
commit | 82c17ecf967c940ae6763c794594b66bac9f882a (patch) | |
tree | 0e65ce9ea56fa0d9119335dc142612349d9f3f91 /examples | |
parent | 021965eedc03dd17b98d56f2bb45cac9b391b7a2 (diff) | |
download | embedlog-82c17ecf967c940ae6763c794594b66bac9f882a.tar.gz embedlog-82c17ecf967c940ae6763c794594b66bac9f882a.tar.bz2 embedlog-82c17ecf967c940ae6763c794594b66bac9f882a.zip |
add option to disable fractions of seconds in compile time
this saves 10bytes from stack memory for each function call
Diffstat (limited to 'examples')
l--------- | examples/el-decode-number.c | 1 | ||||
l--------- | examples/el-encode-number.c | 1 | ||||
l--------- | examples/el-pbinary.c | 1 | ||||
l--------- | examples/el-ts.c | 1 | ||||
-rw-r--r-- | examples/print-options.c | 12 |
5 files changed, 13 insertions, 3 deletions
diff --git a/examples/el-decode-number.c b/examples/el-decode-number.c new file mode 120000 index 0000000..268c6a8 --- /dev/null +++ b/examples/el-decode-number.c @@ -0,0 +1 @@ +../src/el-decode-number.c
\ No newline at end of file diff --git a/examples/el-encode-number.c b/examples/el-encode-number.c new file mode 120000 index 0000000..c90c2c0 --- /dev/null +++ b/examples/el-encode-number.c @@ -0,0 +1 @@ +../src/el-encode-number.c
\ No newline at end of file diff --git a/examples/el-pbinary.c b/examples/el-pbinary.c new file mode 120000 index 0000000..3e46c13 --- /dev/null +++ b/examples/el-pbinary.c @@ -0,0 +1 @@ +../src/el-pbinary.c
\ No newline at end of file diff --git a/examples/el-ts.c b/examples/el-ts.c new file mode 120000 index 0000000..478d0cd --- /dev/null +++ b/examples/el-ts.c @@ -0,0 +1 @@ +../src/el-ts.c
\ No newline at end of file diff --git a/examples/print-options.c b/examples/print-options.c index 0ea88a4..2c619cb 100644 --- a/examples/print-options.c +++ b/examples/print-options.c @@ -32,15 +32,21 @@ int main(void) el_print(ELF, "if higher precision is needed we can use CLOCK_REALTIME"); el_option(EL_TS, EL_TS_SHORT); el_print(ELF, "we can also mix REALTIME with short format"); - el_option(EL_TS_USEC, 0); + el_option(EL_TS_FRACT, EL_TS_FRACT_OFF); el_print(ELF, "and iff you don't need high resolution"); - el_print(ELF, "you can simply disable microseconds to save space!"); + el_print(ELF, "you can disable fractions of seconds to save space!"); + el_option(EL_TS_FRACT, EL_TS_FRACT_MS); + el_print(ELF, "or enable only millisecond resolution"); + el_option(EL_TS_FRACT, EL_TS_FRACT_US); + el_print(ELF, "or enable only microsecond resolution"); + el_option(EL_TS_FRACT, EL_TS_FRACT_NS); + el_print(ELF, "or enable only nanosecond resolution"); el_option(EL_TS, EL_TS_LONG); el_option(EL_TS_TM, EL_TS_TM_CLOCK); el_print(ELF, "or long with clock() if you desire"); el_option(EL_TS, EL_TS_OFF); el_print(ELF, "no time information, if your heart desire it"); - el_option(EL_TS_USEC, 1); + el_option(EL_TS_FRACT, EL_TS_FRACT_NS); el_option(EL_FINFO, 1); el_print(ELF, "log location is very usefull for debuging"); |