-
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 new tests - Add new examples - Update README.md
- Loading branch information
Showing
16 changed files
with
345 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
program example5 | ||
|
||
use fortime | ||
|
||
implicit none | ||
|
||
type(timer) :: t | ||
|
||
call t%dtimer_start() | ||
call sleep(1) ! Perform operations here | ||
call t%dtimer_stop() | ||
|
||
end program example5 |
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 example6 | ||
|
||
use fortime | ||
|
||
implicit none | ||
|
||
type(timer) :: t | ||
integer :: nl, nloops=3 | ||
|
||
call t%dtimer_start() | ||
do nl = 1, nloops | ||
call sleep(1) ! Perform operations ntimes | ||
end do | ||
call t%dtimer_stop(nloops = nloops, message = 'Elapsed time:', print = .true.) ! nloops, message and print are optional. | ||
call t%dtimer_write('example/example6_etimes') ! Optionally, write the elapsed time to a file | ||
|
||
end program example6 |
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.0000000000000000 |
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 test25 | ||
|
||
use kinds | ||
use fortime | ||
use forunittest | ||
|
||
implicit none | ||
|
||
type(timer) :: t | ||
type(unit_test) :: ut | ||
|
||
|
||
! Elapsed time | ||
call t%dtimer_start() | ||
call sleep(1) ! Perform operations here | ||
call t%dtimer_stop() | ||
|
||
call ut%check(res=t%elapsed_dtime, expected=1.0_rk, tol=1.0e-1_rk, msg='test25') | ||
|
||
end program test25 | ||
|
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 test26 | ||
|
||
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%dtimer_start() | ||
do nl = 1, nloops | ||
call sleep(1) ! Perform operations ntimes | ||
end do | ||
call t%dtimer_stop(nloops = nloops, message = 'Elapsed time:') | ||
call t%dtimer_write('test/test26_etimes') ! Optionally, write the elapsed time to a file | ||
|
||
call ut%check(res=t%elapsed_dtime, expected=1.0_rk, tol=1.0e-1_rk, msg='test26') | ||
|
||
end program test26 | ||
|
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.000000000000000 |
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 test27 | ||
|
||
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%dtimer_start() | ||
do nl = 1, nloops | ||
call sleep(1) ! Perform operations ntimes | ||
end do | ||
call t%dtimer_stop(message = 'Elapsed time:') | ||
call t%dtimer_write('test/test27_etimes') ! Optionally, write the elapsed time to a file | ||
|
||
call ut%check(res=t%elapsed_dtime, expected=real(nloops,rk)*1.0_rk, tol=1.0e-1_rk, msg='test27') | ||
|
||
end program test27 | ||
|
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.000000000000000 |
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 test28 | ||
|
||
use kinds | ||
use fortime | ||
use forunittest | ||
|
||
implicit none | ||
|
||
type(timer) :: t | ||
type(unit_test) :: ut | ||
|
||
|
||
! Elapsed time | ||
call t%dtimer_start() | ||
call sleep(1) ! Perform operations here | ||
call t%dtimer_stop(print=.false.) | ||
|
||
call ut%check(res=t%elapsed_dtime, expected=1.0_rk, tol=1.0e-1_rk, msg='test28') | ||
|
||
end program test28 | ||
|
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 test29 | ||
|
||
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%dtimer_start() | ||
do nl = 1, nloops | ||
call sleep(1) ! Perform operations ntimes | ||
end do | ||
call t%dtimer_stop(nloops = nloops, message = 'Elapsed time:', print=.false.) | ||
call t%dtimer_write('test/test29_etimes') ! Optionally, write the elapsed time to a file | ||
|
||
call ut%check(res=t%elapsed_dtime, expected=1.0_rk, tol=1.0e-1_rk, msg='test29') | ||
|
||
end program test29 | ||
|
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.000000000000000 |
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 test30 | ||
|
||
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%dtimer_start() | ||
do nl = 1, nloops | ||
call sleep(1) ! Perform operations ntimes | ||
end do | ||
call t%dtimer_stop(message = 'Elapsed time:', print=.false.) | ||
call t%dtimer_write('test/test30_etimes') ! Optionally, write the elapsed time to a file | ||
|
||
call ut%check(res=t%elapsed_dtime, expected=real(nloops,rk)*1.0_rk, tol=1.0e-1_rk, msg='test30') | ||
|
||
end program test30 | ||
|
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.000000000000000 |