Clicky

Fortran Wiki
cpu_time (changes)

Skip the Navigation Links | Home Page | All Pages | Recently Revised | Authors | Feeds | Export |

Showing changes from revision #1 to #2: (追記) Added (追記ここまで) | (削除) Removed (削除ここまで) | (削除) Chan (削除ここまで)(追記) ged (追記ここまで)

Description

Returns a real value representing the elapsed CPU time in seconds. This is useful for testing segments of code to determine execution time.

If a time source is available, time will be reported with microsecond resolution. If no time source is available, time is set to -1.0.

Note that time may contain a, system dependent, arbitrary offset and may not start with 0.0. For cpu_time, the absolute value is meaningless, only differences between subsequent calls to this subroutine, as shown in the example below, should be used.

Standard

(削除) Fortran 95 and later (削除ここまで)(追記) Fortran 95 (追記ここまで)(追記) and later (追記ここまで)

Class

Subroutine

Syntax

call cpu_time(time)

Arguments

  • time - The type shall be real with intent(out).

Return value

None

Example

program test_cpu_time
 real :: start, finish
 call cpu_time(start)
 ! put code to test here
 call cpu_time(finish)
 print '("Time = ",f6.3," seconds.")',finish-start
end program test_cpu_time

See also

system_clock, date_and_time

category: (削除) Intrinsics (削除ここまで)(追記) intrinsics (追記ここまで)

Revised on April 30, 2009 22:39:23 by Jason Blevins (71.70.142.190) (1094 characters / 0.0 pages)
Edit | Back in time (1 revision) | Hide changes | History | Views: Print | TeX | Source | Linked from: Intrinsic procedures, date_and_time, HowTo, system_clock

AltStyle によって変換されたページ (->オリジナル) /