Thread: Working with clock(); getting unexpected result

  1. #16
    Registered User matrixx333's Avatar
    Join Date
    Mar 2009
    Posts
    67
    TY to everyone for the help...gil_johnson found the bug. When I originally copied the code over to my Intel netbook....I noticed the same problem gil did when I ran the program. I changed the code and tested it again and it worked. I then posted my results in response to Adak's advise

    I took your advise and before doing in-depth research on my mobo and processor I copied the program over to my Intel Atom Netbook......and the function worked perfectly! I got an answer of 0.031000.
    I just never mentioned that I found the bug and corrected it because I thought it was the HTEP/AMD/Intel issue.

    I've sense corrected the code on my AMD machine

    Code:
    lapsed = (double)(end - start)/CLOCKS_PER_SEC;
    When I run the program I am now getting 0.015000 as a result. Thanks again everyone who helped!

    EDIT: In my original post, I actually have the bug fixed but if you download the .c file I attached to the thread, you can find the bug that gil found and corrected. Ironic I had the problem fixed before I even posted the question....I just never updated my original source
    Last edited by matrixx333; 06-03-2010 at 07:20 AM. Reason: more info

  2. #17
    Registered User
    Join Date
    Mar 2010
    Posts
    6
    matrixx333
    That's a relief - I couldn't reproduce the bug with the copy/paste routine I posted. I forgot about poker.c.
    Gil

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with structures and classes
    By jdcollins in forum C++ Programming
    Replies: 1
    Last Post: 11-14-2009, 05:07 PM
  2. endian conversion...
    By roaan in forum C Programming
    Replies: 12
    Last Post: 08-10-2009, 05:54 PM
  3. Buidl Library with ./configure script
    By Jardon in forum C Programming
    Replies: 6
    Last Post: 07-24-2009, 09:36 AM
  4. Inserting a swf file in a windows application
    By face_master in forum Windows Programming
    Replies: 12
    Last Post: 05-03-2009, 11:29 AM
  5. Output problems with structures
    By Gkitty in forum C Programming
    Replies: 1
    Last Post: 12-16-2002, 05:27 AM