Fan simulation with Arduino Mega

Thank you for your response I Write a sample test code by reading several post on forum , that read pwm from computer main board fan but tach signal doesn't show RPM on system info software of main board .

//assume that pin 18 is receiving PWM input
#define PWM_PIN 18
#define TACH_PIN 2
int pulse_time;
//micros when the pin goes HIGH
volatile unsigned long timer_start;
volatile int last_interrupt_time; //calcSignal is the interrupt handler
void calcSignal()
{
//record the interrupt time so that we can tell if the receiver has a signal from the transmitter
last_interrupt_time = micros();
//if the pin has gone HIGH, record the microseconds since the Arduino started up
if(digitalRead(PWM_PIN) == HIGH)
{
timer_start = micros();
}
//otherwise, the pin has gone LOW
else
{
if(timer_start != 0)
{
//record the pulse time
pulse_time = ((volatile int)micros() - timer_start);
//restart the timer
timer_start = 0;
}
}
}

void setup()
{
pinMode(TACH_PIN, OUTPUT);
timer_start = 0;
attachInterrupt(5, calcSignal, CHANGE);
Serial.begin(9600);
}

void loop()
{
Serial.println(pulse_time);

delay(100);
analogWrite(TACH_PIN, 120);
delay(100);

}