Jump to content

Executar Instruções Em Loop


tierrilopes
 Share

Recommended Posts

Em resposta a uma dúvida, para repetir a execução de código pode-se fazer o seguinte:

 

void nome_funcao(){

again:

codigo;

Sleep(1000);

goto again;

}

Para iniciar a execução do loop:

 

CreateThread(NULL, NULL, LPTHREAD_START_ROUTINE(nome_funcao), NULL, 0, 0);

 

O código irá correr, aguardar 1 segundo (1000 milisegundos) e voltar a correr.

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
 Share

×
×
  • Create New...