CPU time
Hi guys,
Is there any simple way to find out the CPU time used for a code in FORTRAN. I just forgot the command. Your help is appreciated. |
Re: CPU time
At the Unix prompt, enter:
time yourprog Manosh |
Re: CPU time
In Fortran directly,
REAL time_begin, time_end ... CALL CPU_TIME(time_begin) ... CALL CPU_TIME(time_end) |
Re: CPU time
Thanks but none did work! Do I have to use the library?
I am writing my code on Unix computer. |
Re: CPU time
Are you using Fortran 90/95? Both of the methods work for my Fortran 90/95 code without linking to any library, however, if you direct your running results to some file, then the first method doesn't work.
|
Re: CPU time
Thanks a lot.
What about function ETIME In the manual it says it should give the CPU time, what I get is very very small values! |
Re: CPU time
This is a code snippet from my Windows Fortran90 program, if it's of any help...
use portlib real elapsed_time elapsed_time=timef() !start processor timer ... program stuff... elapsed_time=timef() !stop processor timer write(*,*) 'execution time: (sec)', elapsed_time end program |
Re: CPU time
Thank you very much!
|
All times are GMT -4. The time now is 12:02. |