Archive: times() system call not working


times() system call not working
Dear Sir/Madam,
I am trying to find out," how to measure system time taken in a system call", I found using times() system call it is possible. But when I am using times() to measure system time taken in a system call then I am getting zero, I have shown the code below, if possible please help me to solve this problem?
Following link discusses about times() system call.
http://www.tutorialspoint.com/unix_s...alls/times.htm
the code is as follows=>
// this code shows times is not working

#include <stdio.h>
#include <sys/times.h>
#include <time.h>
main(){
struct tms t1,t2;
unsigned long temp;
times(&t1);
int c = fork();//doing a system call
if(c !=0){//parent process
times(&t2);
temp = (t2.tms_stime - t1.tms_stime) * 1000 / CLOCKS_PER_SEC;
printf("%lu",temp);
}
}
thanking you,
regards,
Sachin Agarwalla


What does this have to do with NSIS?