Simulation Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

пре 1 година
12345678910111213141516171819202122232425262728
  1. module CTimerLegacy
  2. implicit none
  3. public
  4. type, public :: TimerLegacy
  5. integer, dimension(8) :: StartTime
  6. integer, dimension(8) :: EndTime
  7. contains
  8. procedure :: Start => Start
  9. procedure :: Finish => Finish
  10. procedure :: ElapsedTimeMs => ElapsedTime
  11. end type TimerLegacy
  12. contains
  13. subroutine Start(this)
  14. implicit none
  15. class(TimerLegacy), intent(inout) :: this
  16. call date_and_time(values=this%StartTime)
  17. end subroutine
  18. subroutine Finish(this)
  19. implicit none
  20. class(TimerLegacy), intent(inout) :: this
  21. call date_and_time(values=this%EndTime)
  22. end subroutine
  23. integer function ElapsedTime(this)
  24. implicit none
  25. class(TimerLegacy), intent(inout) :: this
  26. ElapsedTime = (this%EndTime(6)*60000+this%EndTime(7)*1000+this%EndTime(8)) - (this%StartTime(6)*60000+this%StartTime(7)*1000+this%StartTime(8))
  27. end function
  28. end module CTimerLegacy