source: filezilla/trunk/fuentes/src/engine/rtt.h @ 130

Last change on this file since 130 was 130, checked in by jrpelegrina, 3 years ago

First release to xenial

File size: 563 bytes
Line 
1#ifndef FZ_RTT_HEADER
2#define FZ_RTT_HEADER
3
4#include "socket.h"
5
6class CLatencyMeasurement final : public CCallback
7{
8public:
9        CLatencyMeasurement();
10
11        // Returns false if measurement cannot be started due to
12        // a measurement already running
13        bool Start();
14
15        // Returns fals if there was no measurement running
16        bool Stop();
17
18        // In ms, returns -1 if no data is available.
19        int GetLatency() const;
20
21        void Reset();
22
23        virtual void cb();
24
25protected:
26        CMonotonicClock m_start;
27
28        int64_t m_summed_latency{};
29        int m_measurements{};
30
31        mutable mutex m_sync;
32};
33
34#endif
Note: See TracBrowser for help on using the repository browser.