How do you implement a one seconed delay in a C++ program

Discussion in '3DS - Homebrew Development and Emulators' started by RyuShinobi500, Nov 22, 2019.

  1. RyuShinobi500
    OP

    RyuShinobi500 Coder

    Member
    2
    Oct 25, 2019
    United States
    How would I implement a one second delay using C++ thanks
     
  2. Serberker

    Serberker Advanced Member

    Newcomer
    5
    Jan 13, 2019
    Hungary
  3. RyuShinobi500
    OP

    RyuShinobi500 Coder

    Member
    2
    Oct 25, 2019
    United States
    Okay thanks will this work with a 3ds?
     
  4. Serberker

    Serberker Advanced Member

    Newcomer
    5
    Jan 13, 2019
    Hungary
    Probably not, since 3DS is a custom OS.

    In this case I'd dig in the thread.h library -> link
     
  5. RyuShinobi500
    OP

    RyuShinobi500 Coder

    Member
    2
    Oct 25, 2019
    United States
    Okay great thanks have a nice weekend
     
  6. elhobbs

    elhobbs GBAtemp Advanced Fan

    Member
    7
    Jul 28, 2008
    United States
    I believe sleep and usleep should both work as nanosleep has been implemented for newlib on the 3ds. You could also use the 3ds specific svcSleepThread - which expects nanoseconds(be sure to use 64 bit values).
     
    Last edited by elhobbs, Nov 23, 2019
  7. zoogie

    zoogie playing around in the dsiware

    pip Developer
    21
    Nov 30, 2014
    Micronesia, Federated States of
    Last edited by zoogie, Nov 23, 2019
  8. RyuShinobi500
    OP

    RyuShinobi500 Coder

    Member
    2
    Oct 25, 2019
    United States
    zoogie likes this.
Quick Reply
Draft saved Draft deleted
Loading...