mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-11 20:01:35 +00:00
27 lines
669 B
C
27 lines
669 B
C
|
#include <stdio.h>
|
||
|
|
||
|
int main() {
|
||
|
char line[256];
|
||
|
unsigned long long a = 0,b;
|
||
|
unsigned long long difference;
|
||
|
unsigned long long mindiff = -1, maxdiff = 0;
|
||
|
unsigned long long total = 0;
|
||
|
int samples = 0;
|
||
|
|
||
|
while (gets(line)) {
|
||
|
sscanf(line,"%Ld",&b);
|
||
|
if (a) {
|
||
|
difference = b - a;
|
||
|
printf("difference is %Ld\n",difference);
|
||
|
if (difference > maxdiff) maxdiff = difference;
|
||
|
if (difference < mindiff) mindiff = difference;
|
||
|
total += difference;
|
||
|
samples++;
|
||
|
}
|
||
|
a = b;
|
||
|
}
|
||
|
printf("min difference is %Ld, avg %Ld, max is %Ld\n",
|
||
|
mindiff,total/samples,maxdiff);
|
||
|
printf("jitter is %Ld\n",maxdiff-mindiff);
|
||
|
}
|