• This project
    • Loading...
  • Sign in

강현태 / capd2-encryption-optimization

%ea%b7%b8%eb%a6%bc1
Go to a project
Toggle navigation Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Pipelines
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • Snippets
  • Network
  • Create a new issue
  • Builds
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • capd2-encryption-optimization
  • src
  • timer.c
  • 강현태's avatar
    Add timer.c for measuring labtime. · 83a8c436
    83a8c436 Browse Files
    강현태 authored 2018-09-19 22:29:07 +0900
timer.c 327 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include <timer.h>

long tic(void){
    struct timespec time_spec;
    clock_gettime(CLOCK_THREAD_CPUTIME_ID,&time_spec);
    return time_spec.tv_nsec;
}

long toc(long prev){
    struct timespec time_spec;
    int now;
    
    now = clock_gettime(CLOCK_THREAD_CPUTIME_ID,&time_spec);
    return time_speck.tv_nsec - prev;
}