fork(1) download
  1. #include <stdio.h>
  2. #include <stdio.h>
  3. typedef struct
  4. {
  5.  
  6. uint64_t tot, cnt, calls;
  7. //perf_counter() : tot(0), cnt(0), calls(0) {};
  8. inline void reset() { tot = cnt = calls = 0; }
  9. inline void start() { cnt = sds_clock_counter(); calls++; };
  10. inline void stop() { tot += (sds_clock_counter() - cnt); };
  11. inline uint64_t avg_cpu_cycles() { return (tot / calls); };
  12. } perf_counter;
  13.  
  14. int main(void) {
  15. // your code goes here
  16. return 0;
  17. }
  18.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:6:6: error: unknown type name ‘uint64_t’
      uint64_t tot, cnt, calls;
      ^~~~~~~~
prog.c:8:6: error: expected specifier-qualifier-list before ‘inline’
      inline void reset() { tot = cnt = calls = 0; }
      ^~~~~~
stdout
Standard output is empty