Jump to content

position tick definition


HawkXP71

Recommended Posts

HawkXP71

in the API call /Users/{UserId}/PlayingItems/{Id}/Progress

it states 1 tick = 10,000 ms

This means in order to get the actual number of ms from a tick value, you multiply by 10,000

Except its actually 1 ms = 10,000 ticks. and you have to divide by 10,000

For a particular TV show Im experimenting with, Its paused 2:47 using the emby player.

2:47 = 167 seconds, or 167,000 ms, that means the reported tick position if 1 tick = 10,000 ms, should be 1670 ticks.

However, the returned value is 1,679,452,040 ticks, or  167,945 ms if you divide.

I believe this is simply a mistake in the documentation, but its possible the API is returning the wrong value
 

Link to comment
Share on other sites

  • 2 weeks later...
On 7/13/2022 at 9:18 PM, HawkXP71 said:

In swagger for the call above

Can you show a screenshot of what you mean? Thanks.

Link to comment
Share on other sites

OK I think the documentation is correct, right? 1 tick = 10000ms. That is true.

Link to comment
Share on other sites

HawkXP71
2 hours ago, Luke said:

OK I think the documentation is correct, right? 1 tick = 10000ms. That is true.

Microsofts docs say otherwise :)

https://docs.microsoft.com/en-us/dotnet/api/system.datetime.ticks?view=net-6.0

"A single tick represents one hundred nanoseconds or one ten-millionth of a second. There are 10,000 ticks in a millisecond (see TicksPerMillisecond) and 10 million ticks in a second."

Meaning its 1ms = 10000 ticks



 

Link to comment
Share on other sites

HawkXP71
8 minutes ago, Luke said:

Sorry I misread. 1 ms = 10000 ticks.

Yep.  I assume you will file the doc bug? 

  • Thanks 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...