I have aws lambda running python 3 service.
I am measuring my service duration(simple time -time) from the start of the lambda invocation(first invocation line) till the end(last invocation line).
Im getting results that are pretty dramatically different than aws reported duration and billed duration.
Most of the time my measures indicates on average of 730.9 ms
And aws reported duration and billed duration reports on Duration: 1058.36 ms   Billed Duration: 1100 ms.
Where the difference can come from?
Prior to function invocation, the instance must be spun up. I believe AWS Lambda charges for the setup time of the function as part of the execution time.
Any imports or other assets that must be loaded before your function is invoked count against the total execution time, and your timer doesn't start until after that inital loading time.
Difference between aws lambda duration and my measures duration