tag: add realtime unit MSECS (milliseconds)

This commit is contained in:
Daniel Eklöf 2018-12-28 14:05:02 +01:00
parent 13cc11e200
commit b0f0a1e942
2 changed files with 4 additions and 0 deletions

3
tag.c
View file

@ -126,6 +126,9 @@ int_refresh_in(const struct tag *tag, long units)
if (tag->owner == NULL || tag->owner->refresh_in == NULL)
return false;
assert(priv->value_as_int.realtime_unit == TAG_REALTIME_SECS ||
priv->value_as_int.realtime_unit == TAG_REALTIME_MSECS);
long milli_seconds = units;
if (priv->value_as_int.realtime_unit == TAG_REALTIME_SECS)
milli_seconds *= 1000;

1
tag.h
View file

@ -7,6 +7,7 @@
enum tag_realtime_unit {
TAG_REALTIME_NONE,
TAG_REALTIME_SECS,
TAG_REALTIME_MSECS,
};
struct module;