Browse Source

more verbose display (timestamp)

tth 1 year ago
parent
commit
2024a1b342
1 changed files with 8 additions and 1 deletions
  1. 8
    1
      serial/t.c

+ 8
- 1
serial/t.c View File

@@ -25,6 +25,7 @@ int		count, foo;
25 25
 long		temps;
26 26
 char		ligne[200];
27 27
 float		datas[4];
28
+struct tm       *p_tms;
28 29
 
29 30
 for (count=0; count<iters; count++) {
30 31
 	foo = getline_to(sfd, ligne, 100, 0);
@@ -46,7 +47,13 @@ for (count=0; count<iters; count++) {
46 47
 	else	{
47 48
 		fprintf(stderr, "%s: parse -> %d\n", __func__, foo);
48 49
 		}
49
-	if (verbosity > 1) fprintf(stderr, "\n");
50
+	//
51
+	if (verbosity > 1)
52
+		{
53
+		p_tms = localtime(&temps);
54
+		(void)strftime(ligne, 19, "%H:%M:%S", p_tms);
55
+		fprintf(stderr, "\t%s\n", ligne);
56
+		}
50 57
 	}
51 58
 return 0;
52 59
 }

Loading…
Cancel
Save