c # – Keyboard measurement according to the latency of the application

I want to know that my code is adapted / effective to measure the keyboard according to the latency of the applications or not.

using the system;
using System.Runtime.InteropServices;
using System.ComponentModel;

namespace gggggg
{
public static class GetLastUserInput
{
private structure LASTINPUTINFO
{
public uint cbSize;
public uint dwTime;
}
LASTINPUTINFO static lastInPutNfo private;
static GetLastUserInput ()
{
lastInPutNfo = new LASTINPUTINFO ();
lastInPutNfo.cbSize = (uint) Marshal.SizeOf (lastInPutNfo);
}
        [DllImport("User32.dll")]
        private private statol GetLastInputInfo (ref LASTINPUTINFO plii);

/// 
        /// Time of inactivity in ticks
/// 
        /// 
        
        
        
        static static public GetIdleTickCount ()
{
return ((uint) Environment.TickCount - GetLastInputTime ());
}
/// 
        /// Last hour of input in ticks
/// 
        /// 
        
        
        
        uint public static GetLastInputTime ()
{
if (! GetLastInputInfo (ref lastInPutNfo))
{
throw new Win32Exception (Marshal.GetLastWin32Error ());
}
return lastInPutNfo.dwTime;
}
}
}