logswan

Fast Web log analyzer using probabilistic data structures
Log | Files | Refs | README | LICENSE

commit 5ef1e66c20e709af00f201d7bb3e8264ef605003
parent e1767310b4272d6ce90a247ee3cdbeffbe95a6dc
Author: Frederic Cambus <fcambus@users.sourceforge.net>
Date:   Sat, 13 Jun 2015 22:32:52 +0200

Generate and print report timestamp

Diffstat:
Msrc/logswan.c | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/logswan.c b/src/logswan.c @@ -24,6 +24,7 @@ clock_t begin, end; double runtime; +char timeStamp[22]; char lineBuffer[LINE_MAX_LENGTH]; @@ -128,7 +129,12 @@ int main (int argc, char *argv[]) { end = clock(); runtime = (double)(end - begin) / CLOCKS_PER_SEC; + /* Generate timestamp */ + time_t now = time(0); + strftime (timeStamp, 100, "%Y-%m-%d %H:%M:%S", localtime(&now)); + /* Printing results */ + printf("Date : %s\n", timeStamp); printf("Hits : %llu\n", hits); printf("Hits (IPv4): %llu\n", hitsIPv4); printf("Hits (IPv6): %llu\n", hitsIPv6);