Need To Know How Long Your Process Ran?

This simple function returns the time a process takes to run, it needs just the
start and finish times as a notesdate time.

Function TimeTaken(StartTime as NotesdateTime, FinishTime as NotesDateTime) As
String
Dim diff As Long
Dim min As Integer, hr As Integer, sec As Integer
Dim sMin As String, sHr As String, sSec As String

diff = FinishTime.TimeDifference(StartTime)
min =Fix((diff/86400)*(60*24))
sec = Fix(Fraction ((diff/86400)*(60*24) ) * 60) ' done this cus min is
integer
hr = Fix((diff/86400)*(24))
sSec = Cstr(sec)
sMin = Cstr(min)
sHr = Cstr(hr)

If sec < 10 Then sSec = "0" & sec
If min < 10 Then sMin = "0" & min
If hr < 10 Then sHr = "0" & hr

If diff < 60 Then
TimeTaken = "00hrs 00mins "& sSec & "secs"
Elseif diff < 1000 Then
TimeTaken = "00hrs " & sMin & "mins " & sSec & "secs"
Else
TimeTaken = sHr & "hrs " & sMin & "mins " & sSec & "secs"
End If
End Function
This was first published in November 2000

Dig deeper on Domino Resources - Part 7

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchWinIT

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchVirtualDataCentre.co.UK

Close