Homebrew Equivalent of std::chronos::high_resolution_clock and high_resolution_clock::time_point in the 3ds.h

delete12345

Well-Known Member
OP
Member
Joined
Feb 27, 2010
Messages
695
Trophies
1
Age
32
Location
Taipei, Taiwan
XP
1,279
Country
United States
In C++, you have this in the standard library:

Code:
std::chronos::high_resolution_clock
std::chronos::high_resolution_clock::time_point

What is the equivalent of a high resolution clock value used in ctrulib?

Is it osGetTime()? And that is it?
 

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,034
Country
United States
In C++, you have this in the standard library:

Code:
std::chronos::high_resolution_clock
std::chronos::high_resolution_clock::time_point

What is the equivalent of a high resolution clock value used in ctrulib?

Is it osGetTime()? And that is it?
svcGetSystemTick is good for measuring small amounts of elapsed time with a high resolution, but it is not super accurate over long periods of time.
 

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,034
Country
United States
osGetTime() is therefore more accurate over long periods of time?
That depends on what you need for accuracy. Neither one can be used to accurately synchronize a circular buffer for sound playback. But I do believe osGetTime will stay somewhat in sync with the current time. For measuring/comparing elapsed time for things during a frame I would use the tick count. For measuring seconds/minutes I would use os get time.
 

delete12345

Well-Known Member
OP
Member
Joined
Feb 27, 2010
Messages
695
Trophies
1
Age
32
Location
Taipei, Taiwan
XP
1,279
Country
United States
That depends on what you need for accuracy. Neither one can be used to accurately synchronize a circular buffer for sound playback. But I do believe osGetTime will stay somewhat in sync with the current time. For measuring/comparing elapsed time for things during a frame I would use the tick count. For measuring seconds/minutes I would use os get time.
Ok, because I'm still working on the physics engine, and I need tons of accurate timing. :P

I'll stick with osGetTime() then, as I prefer stable/less accuracy over unstable/high accuracy.
 

elhobbs

Well-Known Member
Member
Joined
Jul 28, 2008
Messages
1,044
Trophies
1
XP
3,034
Country
United States
Ok, because I'm still working on the physics engine, and I need tons of accurate timing. :P

I'll stick with osGetTime() then, as I prefer stable/less accuracy over unstable/high accuracy.
Game physics? You don't need much precision for that - either one should work fine. Unless you are running the physics simulation much faster than the typical 60 Hz graphics refresh rate.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Veho @ Veho:
    That's a relief to hear. Do you know what happened?
  • SylverReZ @ SylverReZ:
    @BakerMan, Any idea what happened? I hope that your brother's doing good.
  • BakerMan @ BakerMan:
    Well, from what I've heard from my parents, he had a seizure last night, perhaps an epileptic episode, fucking died, had a near death experience, my dad called the paramedics, they showed up, took him to the hospital, and he woke up covered in tubes, and started complaining.
  • BakerMan @ BakerMan:
    He couldn't eat until after his MRI, when he had a bomb pop.
  • BakerMan @ BakerMan:
    What matters now is that he's doing alright.
  • Veho @ Veho:
    But you still don't know what it was?
  • Veho @ Veho:
    Has he had seizures before?
  • The Real Jdbye @ The Real Jdbye:
    apparently stress can cause seizures, my brother had one during a test once
  • The Real Jdbye @ The Real Jdbye:
    never had one before that, and never had one since
  • Redleviboy123 @ Redleviboy123:
    Question about game texture chanching Do i need an own game id?
  • The Real Jdbye @ The Real Jdbye:
    @Veho for those that want to
    experience being sonic the hedgehog
  • Veho @ Veho:
    Ah, you mean
    furries.
    +1
  • The Real Jdbye @ The Real Jdbye:
    well, sonic fans are a whole separate thing from furries
  • The Real Jdbye @ The Real Jdbye:
    like bronys
  • The Real Jdbye @ The Real Jdbye:
    sonic porn is too weird even for me
  • Dumpflam @ Dumpflam:
    bruh
  • Dumpflam @ Dumpflam:
    guys how do i delete a post
  • The Real Jdbye @ The Real Jdbye:
    you don't
  • The Real Jdbye @ The Real Jdbye:
    you can report it and request deletion
  • BakerMan @ BakerMan:
    Also, no, that was his first time having a seizure, and hopefully the last
    +1
  • K3Nv2 @ K3Nv2:
    Ea play raised priced to $6 a month lol
  • BigOnYa @ BigOnYa:
    Same with uremum, she's now $2 a month
  • K3Nv2 @ K3Nv2:
    Also seizures come and and go they don't have an off switch like that it all depends
    K3Nv2 @ K3Nv2: Also seizures come and and go they don't have an off switch like that it all depends