Commit 5d13544a authored by Stefan Westerfeld's avatar Stefan Westerfeld

testhls: add seek performance test

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent 53798b30
......@@ -433,6 +433,27 @@ test_seek (const string& in, const string& out, int pos, const string& bits)
return 0;
}
int
seek_perf (int sample_rate, int seconds)
{
vector<float> samples (100);
WavData wav_data (samples, 2, sample_rate, 16);
double start_time = get_time();
int rc = mark_zexpand (wav_data, seconds * sample_rate, "0c");
if (rc != 0)
return rc;
double end_time = get_time();
printf ("\n\n");
printf ("total time %7.3f sec\n", end_time - start_time);
printf ("per second %7.3f ms\n", (end_time - start_time) / seconds * 1000);
return 0;
}
int
main (int argc, char **argv)
{
......@@ -449,6 +470,10 @@ main (int argc, char **argv)
{
return test_seek (argv[2], argv[3], atoi (argv[4]), argv[5]);
}
else if (argc == 4 && strcmp (argv[1], "seek-perf") == 0)
{
return seek_perf (atoi (argv[2]), atoi (argv[3]));
}
else
{
error ("testhls: error parsing command line arguments\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment