Skip to content

Instantly share code, notes, and snippets.

@enijkamp
Created August 30, 2017 02:32
Show Gist options
  • Save enijkamp/9c2de809b1001e584f3e0274f2169a19 to your computer and use it in GitHub Desktop.
Save enijkamp/9c2de809b1001e584f3e0274f2169a19 to your computer and use it in GitHub Desktop.
struct timespec start, end;
clock_gettime(CLOCK_MONOTONIC_RAW, &start);
yourKernelHere();
clock_gettime(CLOCK_MONOTONIC_RAW, &end);
uint64_t delta_us = (end.tv_sec - start.tv_sec) * 1000000 + (end.tv_nsec - start.tv_nsec) / 1000;
mexPrintf("%d\n",elapsed);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment