Commit 024fbbdd authored by claes's avatar claes

Function time_Float64ToD added

parent 64680351
/**
* Proview $Id: co_time.c,v 1.11 2006-12-10 14:33:34 lw Exp $
* Proview $Id: co_time.c,v 1.12 2008-09-18 15:08:19 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -905,6 +905,23 @@ time_FloatToD (
return t;
}
pwr_tDeltaTime *
time_Float64ToD (
pwr_tDeltaTime *dt,
pwr_tFloat64 f
)
{
static pwr_tDeltaTime time;
static pwr_tDeltaTime *t = &time;
if (dt != NULL) t = dt;
t->tv_sec = f;
t->tv_nsec = (f - t->tv_sec) * 1e9;
return t;
}
//! Convert time to float.
......
/**
* Proview $Id: co_time.h,v 1.8 2006-12-10 14:33:34 lw Exp $
* Proview $Id: co_time.h,v 1.9 2008-09-18 15:08:12 claes Exp $
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -127,6 +127,7 @@ pwr_tStatus time_SetTime (pwr_tTime*);
#endif
pwr_tDeltaTime * time_FloatToD (pwr_tDeltaTime*, pwr_tFloat32);
pwr_tDeltaTime * time_Float64ToD (pwr_tDeltaTime*, pwr_tFloat64);
pwr_tFloat32 time_DToFloat (pwr_tFloat32*, pwr_tDeltaTime*);
pwr_tDeltaTime * time_Uptime (pwr_tStatus*, pwr_tDeltaTime*, pwr_tDeltaTime*);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment