-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add opttional logical print argument to timer_stop
- Add new tests - Update example2 and example4 - Update README.md
- Loading branch information
Showing
25 changed files
with
423 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
program test13 | ||
|
||
use kinds | ||
use fortime | ||
use forunittest | ||
|
||
implicit none | ||
|
||
type(timer) :: t | ||
type(unit_test) :: ut | ||
|
||
|
||
! Elapsed time | ||
call t%timer_start() | ||
call sleep(1) ! Perform operations here | ||
call t%timer_stop(print=.false.) | ||
|
||
call ut%check(res=t%elapsed_time, expected=1.0_rk, tol=1.0e-3_rk, msg='test13') | ||
|
||
end program test13 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
program test14 | ||
|
||
use kinds | ||
use fortime | ||
use forunittest | ||
|
||
implicit none | ||
|
||
type(timer) :: t | ||
type(unit_test) :: ut | ||
integer :: nl, nloops=3 | ||
|
||
|
||
! Elapsed time with nloops | ||
call t%timer_start() | ||
do nl = 1, nloops | ||
call sleep(1) ! Perform operations ntimes | ||
end do | ||
call t%timer_stop(nloops = nloops, message = 'Elapsed time:', print=.false.) | ||
call t%timer_write('test/test14_etimes') ! Optionally, write the elapsed time to a file | ||
|
||
call ut%check(res=t%elapsed_time, expected=1.0_rk, tol=1.0e-3_rk, msg='test14') | ||
|
||
end program test14 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1.000266666666667 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
program test15 | ||
|
||
use kinds | ||
use fortime | ||
use forunittest | ||
|
||
implicit none | ||
|
||
type(timer) :: t | ||
type(unit_test) :: ut | ||
integer :: nl, nloops=3 | ||
|
||
|
||
! Elapsed time with nloops | ||
call t%timer_start() | ||
do nl = 1, nloops | ||
call sleep(1) ! Perform operations ntimes | ||
end do | ||
call t%timer_stop(message = 'Elapsed time:', print=.false.) | ||
call t%timer_write('test/test15_etimes') ! Optionally, write the elapsed time to a file | ||
|
||
call ut%check(res=t%elapsed_time, expected=real(nloops,rk)*1.0_rk, tol=1.0e-3_rk, msg='test15') | ||
|
||
end program test15 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.000400000000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
program test16 | ||
|
||
use kinds | ||
use fortime | ||
|
||
implicit none | ||
|
||
type(timer) :: t | ||
|
||
|
||
! CPU time | ||
call t%ctimer_start() | ||
call sleep(1) ! Perform operations here | ||
call t%ctimer_stop(print=.false.) | ||
|
||
end program test16 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
program test17 | ||
|
||
use kinds | ||
use fortime | ||
|
||
implicit none | ||
|
||
type(timer) :: t | ||
integer :: nl, nloops=3 | ||
|
||
|
||
! CPU time with nloops | ||
call t%ctimer_start() | ||
do nl = 1, nloops | ||
call sleep(1) ! Perform operations ntimes | ||
end do | ||
call t%ctimer_stop(nloops = nloops, message = 'CPU time:', print=.false.) | ||
call t%ctimer_write('test/test17_ctimes') ! Optionally, write the elapsed time to a file | ||
|
||
end program test17 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.2999999999999993E-04 |
Oops, something went wrong.