Dear Varadharajan:
The best standard procedure for this purpose is the Fortran **95** subroutine
CPU_TIME. It takes a single real argument, which is the elapsed processor time in
seconds. The exact definition of the processor time is left imprecise. If you
want to time a procedure, you need to call CPU_TIME twice, with two separate actual
arguments.
Other alternatives include the F90 SYSTEM_CLOCK subroutine and the
DATE_AND_TIME subroutine. If you want to time sections of code, you will again
need to call either of these subroutines twice, with separate sets of arguments for
the beginning and the end.
There is no standard way in F9x to start a timer at one point and then read
that timer later on. You will need to create your own timer using one of the
subroutines I mentioned above.
varadharajan wrote:
> Hello!
> I wanted to know if there is some F90 command to time subroutines and
> functions withing programs. Whole programs can be timed by the time
> command in unix but what about subroutines within? Is there such a
> facility?
>
> Regards,
> Varadharajan S
>
> *******************************************************************************
> "I felt lonely and content at the same time. I believe that is a rare kind
> of happiness."
> - Bag of Bones
> Stephen King
> *******************************************************************************
--
----------
Sincerely,
Craig T. Dedo Internet: [log in to unmask]
Elmbrook Computer Services, Inc. Voice Phone: (262) 783-5869
17130 W. Burleigh Place Fax Phone: (262) 783-5928
Brookfield, WI 53005-2759
USA
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety." -- Benjamin Franklin (1759)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|