mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Made cTimeMs::Now() static
This commit is contained in:
parent
ab177a1579
commit
f894ce7e00
18
tools.c
18
tools.c
@ -4,7 +4,7 @@
|
||||
* See the main source file 'vdr.c' for copyright information and
|
||||
* how to reach the author.
|
||||
*
|
||||
* $Id: tools.c 1.86 2004/12/26 11:23:35 kls Exp $
|
||||
* $Id: tools.c 1.87 2005/01/04 11:06:45 kls Exp $
|
||||
*/
|
||||
|
||||
#include "tools.h"
|
||||
@ -464,6 +464,14 @@ cTimeMs::cTimeMs(void)
|
||||
Set();
|
||||
}
|
||||
|
||||
uint64 cTimeMs::Now(void)
|
||||
{
|
||||
struct timeval t;
|
||||
if (gettimeofday(&t, NULL) == 0)
|
||||
return (uint64(t.tv_sec)) * 1000 + t.tv_usec / 1000;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void cTimeMs::Set(int Ms)
|
||||
{
|
||||
begin = Now() + Ms;
|
||||
@ -474,14 +482,6 @@ bool cTimeMs::TimedOut(void)
|
||||
return Now() >= begin;
|
||||
}
|
||||
|
||||
uint64 cTimeMs::Now(void)
|
||||
{
|
||||
struct timeval t;
|
||||
if (gettimeofday(&t, NULL) == 0)
|
||||
return (uint64(t.tv_sec)) * 1000 + t.tv_usec / 1000;
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64 cTimeMs::Elapsed(void)
|
||||
{
|
||||
return Now() - begin;
|
||||
|
4
tools.h
4
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.62 2004/12/26 10:26:09 kls Exp $
|
||||
* $Id: tools.h 1.63 2005/01/04 11:06:36 kls Exp $
|
||||
*/
|
||||
|
||||
#ifndef __TOOLS_H
|
||||
@ -104,9 +104,9 @@ private:
|
||||
uint64 begin;
|
||||
public:
|
||||
cTimeMs(void);
|
||||
static uint64 Now(void);
|
||||
void Set(int Ms = 0);
|
||||
bool TimedOut(void);
|
||||
uint64 Now(void);
|
||||
uint64 Elapsed(void);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user