Manage Learn to apply best practices and optimize your operations.

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
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
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"
TimeTaken = sHr & "hrs " & sMin & "mins " & sSec & "secs"
End If
End Function

Dig Deeper on Domino Resources - Part 7

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.




  • iSeries tutorials'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 ...