CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2011
    Posts
    25

    Accurately calculating periperal(device) performance

    Hi, is it possible to accurately determine the performance of peripherals(devices) such as screens, printer, hdds as opposed to just using something like gettickcount?

    Gettickcount reports the absolute time taken for my process to execute, and can be distorted by background processing and is therefore not a completely accurate measure i.e. it serves as a guide only. Higher resolution timers don't fix this eg QueryPerformanceCounter. So my first problem involves getting the cpu time that my process used to execute (independently to all other processes running in the background).

    Then in relation to perioheral performance, as I understand it, within an application which interacts with a peripheral, as all IO is handled by the kernel, the application has to change from user mode and then enter kernel mode which contains the methods necessary to interact with the peripheral and the peripheral's drivers. For example, to show the user something on the screen, an application would make a request to the kernel, which would forward the request to its display driver, which is then responsible for actually plotting the character/pixel.

    So it seems to me that there might be some way of getting access to the amount of time between when the OS started to communicate with the peripheral driver and when the driver reports that it has finished the operation back to the OS.

    I have tried looking at GetProcessTimes, as it seemed to indicate that it was able to return the amount of time a process is spending in kernel mode and I thought I could use that as a proxy for the amount of time communicating with peripheral drivers, although after checking it out, it seems to only returns absolute numbers rather than process specific numbers, i.e. if my process takes 42 milliseconds to execute it will only tell me the total amount of time spent by the cpu in user and kernel mode rather than the amount of time my process is spending in the kernel and user modes (absolute cpu numbers not process specific numbers).

    Is there a way for me to accurately measure peripheral performance, or is the less accurate GettickCount as far as I can go?

  2. #2
    Join Date
    Jan 2011
    Posts
    25

    Re: Accurately calculating periperal(device) performance

    The problem I described in relation to GetProcessTimes also effects NtQueryInformationProcess.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured