Move a function from components/espmqtt to here to prevent gettimeofday() calls.
Authored by: dannybackx 2019-02-16
Parent: [r172]
Child: [r174]