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

Last change on this file since 3185 was 3185, checked in by jrpelegrina, 2 years ago

Update new version: 3.15.02

File size: 571 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        fz::monotonic_clock m_start;
27
28        int64_t m_summed_latency{};
29        int m_measurements{};
30
31        mutable fz::mutex m_sync;
32};
33
34#endif
Note: See TracBrowser for help on using the repository browser.