CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   time (https://www.cfd-online.com/Forums/main/11917-time.html)

jj August 1, 2006 23:21

time
 
dear all, can any one help me how to write code in visual c++ for calculating total time for simulation..i mean what is total time taken for getting results... plz tell what are the commnds available .. thanks in advance

Harish August 2, 2006 01:57

Re: time
 
#include<time.h>

int main(void) { time_t start,end;

time(&start); ...

...

time(&end);

cout<<difftime(end,start); return 0; }

The difftime prints the time of run in seconds.

Harish August 2, 2006 01:58

Re: time update
 
cout<<difftime(end,start) prints time of run in seconds



All times are GMT -4. The time now is 10:34.