time_begin Subroutine

public subroutine time_begin()

This subroutine is for timing purpose and starts a stopwatch.

Arguments

None

Source Code

   subroutine time_begin()
      implicit none

      if (get_os_type() == OS_WINDOWS) then
         is_supported = QueryPerformanceFrequency(frequency)
         if (is_supported) then
            is_succeeded = QueryPerformanceCounter(time_begin_qhc)
         else
            !$ begin_s = omp_get_wtime()
            !$ last_s = begin_s
            !$ return
            call use_cpu_time_begin
         end if
      else
         !$ begin_s = omp_get_wtime()
         !$ last_s = begin_s
         !$ return
         call use_cpu_time_begin
      end if

   contains

      subroutine use_cpu_time_begin
         implicit none
         begin_s = 0d0
         last_s = 0d0
         end_s = 0d0
         call cpu_time(begin_s)
         last_s = begin_s
      end subroutine use_cpu_time_begin

   end subroutine time_begin