# What does the timestamp from getStats represent?

**URL:** <https://mediasoup.discourse.group/t/what-does-the-timestamp-from-getstats-represent/1685>\
**Category:** mediasoup libraries\
**Created:** [September 1, 2020, 1:42pm UTC](https://mediasoup.discourse.group/t/what-does-the-timestamp-from-getstats-represent/1685 "2020-09-01T13:42:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexciarlillo](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/alexciarlillo/32/131_2.png) [@alexciarlillo](https://mediasoup.discourse.group/u/alexciarlillo)\
**Post date:** [September 1, 2020, 1:42pm UTC](https://mediasoup.discourse.group/t/what-does-the-timestamp-from-getstats-represent/1685/1 "2020-09-01T13:42:01Z")

</div>

I was kind of expecting a unix timestamp here indicating either when the getStats call was made or when the stats were last internally updated/tracked. This does not appear to be a unix timestamp though, so I am wondering what it is relative to?

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [September 1, 2020, 1:47pm UTC](https://mediasoup.discourse.group/t/what-does-the-timestamp-from-getstats-represent/1685/2 "2020-09-01T13:47:12Z")

</div>

Unclear whether you mean client or server stats.

---

<div class="post-metadata">

**Author:** ![alexciarlillo](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/alexciarlillo/32/131_2.png) [@alexciarlillo](https://mediasoup.discourse.group/u/alexciarlillo)\
**Post date:** [September 1, 2020, 1:52pm UTC](https://mediasoup.discourse.group/t/what-does-the-timestamp-from-getstats-represent/1685/3 "2020-09-01T13:52:04Z")

</div>

Oops sorry about that. I am referring to server stats here.

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [September 1, 2020, 2:12pm UTC](https://mediasoup.discourse.group/t/what-does-the-timestamp-from-getstats-represent/1685/4 "2020-09-01T14:12:55Z")

</div>

`timestamp` field in server stats is set using this:

```c++
static uint64_t GetTimeMs()
{
	return static_cast<uint64_t>(uv_hrtime() / 1000000u);
}

```

where `uv_hrtime()` is defined here:

- [Miscellaneous utilities - libuv documentation](http://docs.libuv.org/en/v1.x/misc.html#c.uv_hrtime)

> Returns the current high-resolution real time. This is expressed in nanoseconds. It is relative to an arbitrary time in the past. It is not related to the time of day and therefore not subject to clock drift. The primary use is for measuring performance between intervals.

So, answering your questions, it’s a random value (or better said: it’s an incremental value whose base is random).

Feel free to open an issue in GitHub requesting that such a `timestamp` should provide the same as `Date.now()` in JavaScript, this is: “the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC”.
