Advertisement
Guest User

Untitled

a guest
Feb 18th, 2017
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. struct Result sum_naive(){
  2.         size_t i;
  3.         struct Result res;
  4.         int16_t val;
  5.  
  6.         gettimeofday(&res.time_start, NULL);
  7.         res.sum = 0;
  8.         for(i = 0; i < SIZE; i++){
  9.                 val = data[i] * VOL;
  10.                 output[i] = val;
  11.                 res.sum += val;
  12.         }
  13.         gettimeofday(&res.time_end, NULL);
  14.  
  15.         return res;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement