summaryrefslogtreecommitdiffstats
path: root/SD-VBS/common/matlab/timingFuncs/photonEndTiming.c
diff options
context:
space:
mode:
authorleochanj105 <leochanj@live.unc.edu>2020-10-19 23:09:30 -0400
committerleochanj105 <leochanj@live.unc.edu>2020-10-20 02:40:39 -0400
commitf618466c25d43f3bae9e40920273bf77de1e1149 (patch)
tree460e739e2165b8a9c37a9c7ab1b60f5874903543 /SD-VBS/common/matlab/timingFuncs/photonEndTiming.c
parent47ced4e96bbb782b9e780e8f2cfc637b2c21ff44 (diff)
initial sd-vbs
initial sd-vbs add sd-vbs sd-vbs
Diffstat (limited to 'SD-VBS/common/matlab/timingFuncs/photonEndTiming.c')
-rw-r--r--SD-VBS/common/matlab/timingFuncs/photonEndTiming.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/SD-VBS/common/matlab/timingFuncs/photonEndTiming.c b/SD-VBS/common/matlab/timingFuncs/photonEndTiming.c
new file mode 100644
index 0000000..bbf5231
--- /dev/null
+++ b/SD-VBS/common/matlab/timingFuncs/photonEndTiming.c
@@ -0,0 +1,15 @@
1#include"mex.h"
2#include <stdio.h>
3#include <stdlib.h>
4#include <stdint.h>
5#include <math.h>
6
7void mexFunction(int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[])
8{
9 uint32_t* cycles;
10 plhs[0] = mxCreateNumericMatrix(1, 2, mxUINT32_CLASS, mxREAL);
11 cycles = (uint32_t*)mxGetPr(plhs[0]);
12 __asm__ __volatile__( "rdtsc": "=a" (cycles[0]), "=d" (cycles[1]));
13
14 return;
15}