Files
hardware_interfaces/tv/tuner/aidl/default/Timer.h
sadiqsada 56c98294a2 Add IPTV default implementation
Frontend::tune(): create a streamer using plugin interface to
read a byte and return LOCKED event if byte is read

Demux::setFrontendDataSource():open a new stream to read data
from the socket and push the data read to DVR FMQ.

Test: atest VtsHalTvTunerTargetTest
Bug: 288170590
Change-Id: Iaf2eae7b4dc9e7d69b1f7b3a367d24f6acdd68be
2023-11-02 16:45:31 -07:00

17 lines
450 B
C++

#include <chrono>
using namespace std::chrono;
class Timer {
public:
Timer() { start_time = steady_clock::now(); }
~Timer() { stop_time = steady_clock::now(); }
double get_elapsed_time_ms() {
auto current_time = std::chrono::steady_clock::now();
return duration_cast<milliseconds>(current_time - start_time).count();
}
private:
time_point<steady_clock> start_time;
time_point<steady_clock> stop_time;
};