File: bench_bounce.cpp

package info (click to toggle)
liblsl 1.16.2b1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 1,724 kB
  • sloc: cpp: 12,515; ansic: 666; python: 28; sh: 25; makefile: 18
file content (22 lines) | stat: -rw-r--r-- 523 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "../common/create_streampair.hpp"
#include "../common/lsltypes.hpp"
#include <catch2/catch.hpp>
#include <lsl_cpp.h>

// clazy:excludeall=non-pod-global-static

TEST_CASE("bounce", "[basic][latency]") {
	auto sp = create_streampair(lsl::stream_info("bounce", "Test"));

	float data = .0;
	BENCHMARK("single bounce") {
		sp.out_.push_sample(&data);
		sp.in_.pull_sample(&data, 1.);
	};

	sp.out_.push_sample(&data);
	BENCHMARK("primed bounce") {
		sp.out_.push_sample(&data);
		sp.in_.pull_sample(&data, 1.);
	};
}