summaryrefslogtreecommitdiffstats
path: root/src/datasource/networkspeed.h
diff options
context:
space:
mode:
authorSimon Rettberg2017-02-24 12:33:55 +0100
committerSimon Rettberg2017-02-24 12:33:55 +0100
commitd4f10f9fe446da2aff65088e5236d6ffcdd034b5 (patch)
tree5d7467a6f67272064619c000a14800e706368ac6 /src/datasource/networkspeed.h
downloadspeedcheck-d4f10f9fe446da2aff65088e5236d6ffcdd034b5.tar.gz
speedcheck-d4f10f9fe446da2aff65088e5236d6ffcdd034b5.tar.xz
speedcheck-d4f10f9fe446da2aff65088e5236d6ffcdd034b5.zip
initial commit
Diffstat (limited to 'src/datasource/networkspeed.h')
-rw-r--r--src/datasource/networkspeed.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/datasource/networkspeed.h b/src/datasource/networkspeed.h
new file mode 100644
index 0000000..482f4cd
--- /dev/null
+++ b/src/datasource/networkspeed.h
@@ -0,0 +1,24 @@
+#ifndef NETWORKSPEED_H_
+#define NETWORKSPEED_H_
+
+#include "idatasource.h"
+#include <QElapsedTimer>
+#include <QFile>
+
+class NetworkSpeed : public IDataSource {
+public:
+ NetworkSpeed();
+ virtual ~NetworkSpeed();
+
+ virtual qint64 read();
+ virtual const QList<qint64>& getBars() const;
+ virtual qint64 getMaximum();
+
+private:
+ qint64 _lastBytes;
+ qint64 _lastMs;
+ QElapsedTimer _timer;
+ QFile _file;
+};
+
+#endif /* NETWORKSPEED_H_ */