From 28d5505edae76ed91708a895815eecf542c23060 Mon Sep 17 00:00:00 2001 From: Niklas Halle Date: Thu, 3 Dec 2020 17:37:01 +0100 Subject: inital, matleap api based on https://github.com/tomh4/matleap --- test_matleap.m | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100755 test_matleap.m (limited to 'test_matleap.m') diff --git a/test_matleap.m b/test_matleap.m new file mode 100755 index 0000000..0c6c322 --- /dev/null +++ b/test_matleap.m @@ -0,0 +1,57 @@ +% @file test_matleap.m +% @brief test matleap functionality +% @author Jeff Perry +% @version 1.0 +% @date 2013-09-12 + +function test_matleap + % remove matleap mex-file from memory + % set debug on + %matleap_debug + % show version + [version]=matleap_version; + fprintf('matleap version %d.%d\n',version(1),version(2)); + % pause to let the hardware wake up + sleep(1) + % get some frames + frame_id=-1; + frames=0; + tic + while(toc<10) + % get a frame + f=matleap_frame; + % only count it if it has a different id + if f.id~=frame_id + frame_id=f.id; + print(f) + frames=frames+1; + end + end + s=toc; + % display performance + fprintf('%d frames\n',frames); + fprintf('%f seconds\n',s); + fprintf('%f fps\n',frames/s); +end + +% sleep for t seconds +function sleep(t) + tic; + while (toc