Thread: getrusage

  1. #1
    Registered User
    Join Date
    Sep 2003


    hello, I'm having trouble using getrusage, I am trying to use it to measure the resource usage and execution time of an algorithm. The structure "struct timeval ru_utime;" contained within the rusage structure should give me the information im looking for, but i dont know what this structure actually is, etc.

    could u pls tell me if this is the way this should be coded?


    int who;
    rusage usage;
    FRAME message;

    who = RUSAGE_SELF;

    populate_data(; /* populate the data */
    checksum_crc16(, MAXSIZE); /* calculate checksum (algorithm to be tested for usage*/
    getrusage(who, usage);


  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 04-23-2008, 09:03 AM