summaryrefslogtreecommitdiff
path: root/tools.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2004-12-19 18:08:09 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2004-12-19 18:08:09 +0100
commitc49253824a46a45dac86d2a0404b9d5c6e1a92a4 (patch)
treec81bb3537cd4670d6eddc062d0f0f92a43ade8d2 /tools.h
parentce8369251cf64919a7f1a8333201d87f92fb2f14 (diff)
downloadvdr-c49253824a46a45dac86d2a0404b9d5c6e1a92a4.tar.gz
vdr-c49253824a46a45dac86d2a0404b9d5c6e1a92a4.tar.bz2
Replaced time_ms() with a threadsafe and non-overflowing cTimeMs
Diffstat (limited to 'tools.h')
-rw-r--r--tools.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/tools.h b/tools.h
index 71e7d884..2c90ff75 100644
--- a/tools.h
+++ b/tools.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.h 1.60 2004/12/19 17:20:05 kls Exp $
+ * $Id: tools.h 1.61 2004/12/19 18:06:10 kls Exp $
*/
#ifndef __TOOLS_H
@@ -71,7 +71,6 @@ bool startswith(const char *s, const char *p);
bool endswith(const char *s, const char *p);
bool isempty(const char *s);
int numdigits(int n);
-int time_ms(void);
bool isnumber(const char *s);
int FreeDiskSpaceMB(const char *Directory, int *UsedMB = NULL);
bool DirectoryOk(const char *DirName, bool LogErrors = false);
@@ -82,6 +81,17 @@ char *ReadLink(const char *FileName);
bool SpinUpDisk(const char *FileName);
time_t LastModifiedTime(const char *FileName);
+class cTimeMs {
+private:
+ uint64 begin;
+public:
+ cTimeMs(void);
+ void Set(int Ms = 0);
+ bool TimedOut(void);
+ uint64 Now(void);
+ uint64 Elapsed(void);
+ };
+
class cBufferedStringFunction {
protected:
char *buffer;