I have to get the execution time of a Python script with 100 different input values, so I wrote the following C program
#include <stdlib.h>
#include <stdio.h>
int main(void) {
int i;
char command [200];
for (i = 1; i <= 100; ++i) {
sprintf(command, "time python program.py %d", i);
system(command);
};
return 0;
};
With this program I can see the execution time of each execution, but I'd like to be able to catch it in a variable. Is there a way to do that?