From d950ab2823f0db95757b94bc02443a76d21f51cb Mon Sep 17 00:00:00 2001 From: Jan Klemkow Date: Tue, 29 Jan 2013 13:57:41 +0100 Subject: add second diff over diff --- src/advtime.c | 7 ++++--- src/draw.plot | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/advtime.c b/src/advtime.c index 4c329da..24be53c 100644 --- a/src/advtime.c +++ b/src/advtime.c @@ -66,7 +66,7 @@ main(int argc, char **argv) int ret, ch; int diff_flag = 0, average_flag = 0; int64_t timestamp = 0; - double diff = 0.0; + double diff = 0.0, old_diff = 0.0; char filename[BUFSIZ]; while ((ch = getopt(argc, argv, "ad")) != -1) { @@ -129,8 +129,9 @@ main(int argc, char **argv) printf("\t"); if (diff_flag == 1) { - diff = frame_diff(frame_a, frame_b); -// printf("%f", diff); + printf("%f", diff = frame_diff(frame_a, frame_b)); + printf("\t%f", (diff - old_diff)); + old_diff = diff; } if (diff > 40.0) { diff --git a/src/draw.plot b/src/draw.plot index c3de0a6..dc8a538 100644 --- a/src/draw.plot +++ b/src/draw.plot @@ -1,8 +1,8 @@ # draw frame diff graph -set terminal svg size 800,600 dynamic; - -set output "graph.svg"; +#set terminal svg size 800,600 dynamic; +#set output "graph.svg"; plot 'data.txt' using 2 with lines lt rgb "#204a87" title "average", \ - 'data.txt' using 3 with lines lt rgb "#a40000" title "diff"; + 'data.txt' using 3 with lines lt rgb "#a40000" title "diff", \ + 'data.txt' using 4 with lines lt rgb "#4e9a06" title "rise"; -- cgit