aboutsummaryrefslogtreecommitdiffstats
path: root/examples/print-options.c
diff options
context:
space:
mode:
authorMichał Łyszczek <michal.lyszczek@bofc.pl>2018-04-18 13:44:26 +0200
committerMichał Łyszczek <michal.lyszczek@bofc.pl>2018-04-18 13:44:26 +0200
commit82c17ecf967c940ae6763c794594b66bac9f882a (patch)
tree0e65ce9ea56fa0d9119335dc142612349d9f3f91 /examples/print-options.c
parent021965eedc03dd17b98d56f2bb45cac9b391b7a2 (diff)
downloadembedlog-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/print-options.c')
-rw-r--r--examples/print-options.c12
1 files changed, 9 insertions, 3 deletions
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");