Category Codes

A simple code to calculate runtime

The code below gives the time difference between the execution of two code snippets. It uses the system’s microsecond clock. #include <stdio.h> #include <sys/time.h> void main() { struct timeval tv;         //this structure is defined in the system, and contains the variables tv_sec, //which records seconds, and tv_usec, which records microseconds. struct timeval […]