1

I wanted to make an application for android and I need to use Sleep() but windows.h library doesn't work with android, sa how can I use waiting time on Android ? (using Qt c++)

Please answer me exactly what I must to do and where in code, in which file (headers/source/main), and how can I use this function(example)

dtech
  • 47,916
  • 17
  • 112
  • 190
4C554B41 504C
  • 73
  • 3
  • 10

1 Answers1

3

QThread also provides static, platform independent sleep functions: sleep(), msleep(), and usleep() allow full second, millisecond, and microsecond resolution respectively.

So you can simply:

QThread::msleep(ms);

It will cause the current thread you are in to sleep for ms milliseconds. You need to #include <QThread> obviously.

dtech
  • 47,916
  • 17
  • 112
  • 190