A way to calculate the time taken by a part of source code (very simple and rarely useful but... I was tired of writing these lines every time).
Usage:
B4X:
Sub TakeTime
Dim CurrTimeFormat As String = DateTime.TimeFormat
DateTime.TimeFormat = "mm:ss:SSS"
Dim Now As Long = DateTime.Now
Wait for StopTakeTime
Now = DateTime.Now - Now
Log("Elapsed time: " & DateTime.Time(Now))
DateTime.TimeFormat = CurrTimeFormat
End Sub
Usage:
B4X:
TakeTime
' here the code to test
CallSub(Me, "StopTakeTime")