I'm trying to calculate the time between the data sending from my device to azure service bus topic. I have azure function to listen topic. Also, the data I sent to the topic has a DateTime. In azure function, I create new DateTime and minus the DateTime from topic data. it should be give me the time between sending to receiving. However, I got lots of negative data.
try
{
await client.PostAsJsonAsync("api/device", device);
releaseLoop= true;
}
catch (Exception e)
{
log.Info("Exception Message: "+e);
}
finally
{
log.Info($"{data.DeviceName} Total runing time "+(DateTime.UtcNow-data.timerInfo).Milliseconds+"ms");
}
logInfo from azure function.
2017-11-13T04:44:36.976 3060 ipad Total runing time 412ms
2017-11-13T04:44:36.976 Function completed (Success, Id=57c528fe-589d-4edc-b285-4dfe481f2aee, Duration=119ms)
2017-11-13T04:44:37.427 Function started (Id=33469551-3873-468d-8ecf-df0b72d8e951)
2017-11-13T04:44:36.352 3049 iphone Total runing time 910ms
2017-11-13T04:44:36.352 Function completed (Success, Id=d233a8e7-1852-4d72-a8f6-5ebc9c4b3d36, Duration=130ms)
2017-11-13T04:44:36.368 Function started (Id=ed19f6e8-7db2-440c-872f-205078a6c0f5)
2017-11-13T04:44:36.477 3061 ipad Total runing time -188ms
2017-11-13T04:44:36.477 Function completed (Success, Id=ed19f6e8-7db2-440c-872f-205078a6c0f5, Duration=109ms)
2017-11-13T04:44:36.687 Function started (Id=feee0174-7461-4ab4-939d-48ca8377ae10)
2017-11-13T04:44:36.793 3064 ipad Total runing time -179ms
2017-11-13T04:44:36.793 Function completed (Success, Id=feee0174-7461-4ab4-939d-48ca8377ae10, Duration=117ms)
2017-11-13T04:44:37.191 Function started (Id=487d5657-5433-48f0-b4bb-e24e80375d5a)
2017-11-13T04:44:37.301 3069 surface pro Total runing time -181ms
2017-11-13T04:44:37.301 Function completed (Success, Id=487d5657-5433-48f0-b4bb-e24e80375d5a, Duration=108ms)
2017-11-13T04:44:36.726 3063 iphone Total runing time -143ms