Thread: getrusage

  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    1

    getrusage

    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?

    <code>

    int who;
    rusage usage;
    FRAME message;

    who = RUSAGE_SELF;

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

    </code>

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    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