diff --git a/src/Entity.php b/src/Entity.php index 6c99df0..faf66c4 100644 --- a/src/Entity.php +++ b/src/Entity.php @@ -34,18 +34,18 @@ class Entity * * @param $tag * @param $data - * @param int $time unixtime + * @param int|float $time unixtime with microseconds */ public function __construct($tag, $data, $time = null) { - if (is_long($time)) { + if (is_long($time) || is_float($time)) { $this->time = $time; } else { if (!is_null($time)) { error_log("Entity::__construct(): unexpected time format `{$time}` specified."); } - $this->time = time(); + $this->time = microtime(true); } $this->tag = $tag; @@ -81,4 +81,4 @@ public function getTime() { return $this->time; } -} \ No newline at end of file +}