Add Timer as an alternative to osi alarm
* Add a private method MessageLoopThread.DoInThreadDelayed to post a
delayed task in message loop, as an alternative approach to osi alarm
clock
* Add a unit test for MessageLoopThread to check ShutDown() waits until
current task finishes
* Add Timer using MessageLoopThread.DoInThreadDelayed
* Timer provides similar API as osi alarm, and uses same OS clock (boot
timer) as alarm
* Add benchmark and unit tests to ensure the performance is comparable
to the existing osi alarm
Test: Run unit test and benchmark test
./test/run_unit_tests.sh bluetooth_test_common
./test/run_benchmarks.sh bluetooth_benchmark_timer_performance
--benchmark_repetitions=10 --benchmark_report_aggregates_only=true
Bug:
110303473
Change-Id: I6f2e7ae2f80f9889fc5fe3c8cd6b9b2670938b46