Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

a function like delay() from pascal

garagara Member Posts: 2
i am on search for a function that wait a time, without kill the performance...


time2 = akttime();
do{
time1 = akttime();
}while((time1 - time2)>3)

routines like are not what i search...

the program should run in the background an start every 5 seconds an action

Comments

  • GiantGiant Member Posts: 225
    Why not just use the sleep( seconds ) or delay (miliseconds) (IN DOS) or Sleep( miliseconds ) (IN WINDOWS) function calls. These will just make the program stop for a given time< and continue on afterwards, which from the piece of code you wrote is exactly what you want.



    Ciaran McCormack
    www.ciaranmccormack.tk

    "Only two things are infinite, the universe and human stupidity, and I'm not sure about the former." --Albert Einstein

  • KITEKITE Member Posts: 4
    If you write you program under Windows and want it to do something with given frequency, use SetTimer(uDelay) and handle WM_TIMER message
    ___________________________
    Warm regards,
    Vladimir V. Polischuk
    AlarIT developer
    E-mail: greykite@mail.ru
    URL: http://www.alarit.com
  • Chris BrownChris Brown USAMember Posts: 4,496 ✭✭

    || http://forcoder.org || free ebooks and video tutorials about / C++, Scratch, Visual Basic .NET, R, Delphi, Perl, PHP, Ruby, Swift, PL/SQL, Visual Basic, Python, C#, Objective-C, C, JavaScript, Go, Java, Assembly, MATLAB FoxPro, Rust, Prolog, SAS, VBScript, Erlang, Awk, Clojure, ABAP, Ada, Dart, Lua, LabVIEW, Logo, Kotlin, Transact-SQL, Crystal, Fortran, D, Alice, Apex, ML, F#, Hack, Bash, Scala, COBOL, Julia, Lisp, Scheme / _________

Sign In or Register to comment.