简体   繁体   English

Android上的windows.h库

[英]windows.h library on Android

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 ? 我想为android制作一个应用程序,我需要使用Sleep()但是windows.h库不适用于android,sa我怎样才能在Android上使用等待时间? (using Qt c++) (使用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) 请准确回答我必须做的事情以及代码中的位置,文件(headers / source / main)以及如何使用此函数(示例)

QThread also provides static, platform independent sleep functions: sleep(), msleep(), and usleep() allow full second, millisecond, and microsecond resolution respectively. QThread还提供静态的,独立于平台的睡眠功能:sleep(),msleep()和usleep()分别允许完整的秒,毫秒和微秒分辨率。

So you can simply: 所以你可以简单地说:

QThread::msleep(ms);

It will cause the current thread you are in to sleep for ms milliseconds. 它将导致您当前的线程休眠ms毫秒。 You need to #include <QThread> obviously. 你需要#include <QThread>显然。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM