A timer is used flush the apm data 100 milliseconds before the lambda function times out. It's used as a fallback in case the logs API isn't available.
I've found while testing locally using the sam cli that the timer doesn't actually fire.
Investigate if the time units are correct.