Jump to content
Sign in to follow this  
tierrilopes

Executar Instruções Em Loop

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.

Share this post


Link to post
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
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.

Our website is made possible by displaying online advertisements to our visitors.
Please consider supporting us by disabling your ad blocker.
You will be able to see content when you disable your adblocker and enable javascript.