problem with simple clock() call

From: donno (yo_donno_at_outerspace.com)
Date: 09/30/04

  • Next message: Kasper Dupont: "Re: problem with simple clock() call"
    Date: Thu, 30 Sep 2004 11:38:54 GMT
    
    

    Man, I'm scratching my head on this one -
    I'm trying to get a simple timer function running, and
    the standard API clock() is not working.

    I've tried this on 2 different Linux boxes, RH9 and FC2

    Here's the code

    #include <iostream>
    #include <time.h>

    int main(int argc,char *argv[]){

            double start, end;

            char myin;

            start = clock();
            std::cout << "Press any key, then enter" << std::endl;
            std::cin >> myin;
            end = clock();
            std::cout << "start = " << start << " end = " << end << std::endl;
            
    return 0;
    }

    I just get start = 0 end = 0

    wierd.

    TIA,
    replies to mailing list only, por favor.

    Don


  • Next message: Kasper Dupont: "Re: problem with simple clock() call"

    Relevant Pages

    • Re: problem with simple clock() call
      ... I'm scratching my head on this one - ... > the standard API clock() is not working. ...
      (comp.os.linux.development.apps)
    • Re: Where is tracking tab?
      ... hair has been pulled out or the head has been scratched repeatedly. ... the (insert latest virus name here) virus, all mail sent to my personal ... After furious head scratching, Frou-Frou asked: ... My operating system is Windows XP. ...
      (microsoft.public.outlook)
    • Re: Im such a meanie
      ... First I scratched him on top of his head. ... Every time I came back to scratching the top of his head, ... know how it is when you want to laugh and you're not supposed to. ... startled by the sudden explosion of noise coming from his source of calm ...
      (rec.pets.cats.anecdotes)
    • Re: Y&R The New Methodology
      ... The first few times something happened off screen, I scratched my head ... have heard Lily tell Neil the specifics of her fight with Daniel. ... doesn't make sense, or scratching heads wondering if they missed a day, ...
      (rec.arts.tv.soaps.cbs)
    • Re: SPi to carb MINI conversion
      ... does and bolt on a K&N without taking the car to a rolling road to get ... the carburettor jetted for it then sit there scratching their head ...
      (uk.rec.cars.modifications)