Serial.println(millis); creates an error, how can millis be sent serial port

I am trying to transfer some pulse reading over the serial port. When I tried

Serial.println(millis );
I got an error so I changed to

timeTemp = millis();
     Serial.print("millis ");
     Serial.println(timeTemp);

This my complete code

 volatile byte rpmcount;

 unsigned int rpm;

 unsigned long timeold;
unsigned long timeTemp;
 void setup()
 {
   Serial.begin(9600);
   attachInterrupt(0, rpm_fun, RISING);

   rpmcount = 0;
   rpm = 0;
   timeold = 0;
   timeTemp = 0;
 }

 void loop()
 {
   if (rpmcount >= 20) { 
     //Update RPM every 20 counts, increase this for better RPM resolution,
     //decrease for faster update
     rpm = 30*1000/(millis() - timeold)*rpmcount;
     
     timeTemp = millis();
     Serial.print("millis ");
     Serial.println(timeTemp,DEC);
     
     Serial.print("timeold ");
     Serial.println(timeold);
     
     Serial.print("rpmcount ");
     Serial.println(rpmcount);

     
     timeold = millis();
     rpmcount = 0;
   }
     
 }

 void rpm_fun()
 {
   rpmcount ++;
   //Each rotation, this interrupt function is run twice
   Serial.println(rpmcount);
 }

Serial.println(rpmcount); outputs 1,2,3..........19,20
but
timeTemp outputs 0
timeold ouputs 0.0
rpmcount outputs 0

Am I missing something, all help appreciated and thank you in advance.

Try this...

rpm = (30UL*1000UL*rpmcount) / (millis() - timeold);

I suspect the problem is using Serial.println() inside rpm_fun(). I'd be surprised if serial output worked inside an interrupt service routine.

TimFr:
I am trying to transfer some pulse reading over the serial port. When I tried

Serial.println(millis );
I got an error

Well, that code seems to be trying to print a function pointer, which doesn't seem like a useful thing to do. If you intended to print the function's return value, you could achieve that by something like this:
Serial.println(millis());

PeterH:

TimFr:
I am trying to transfer some pulse reading over the serial port. When I tried

Serial.println(millis );
I got an error

Well, that code seems to be trying to print a function pointer, which doesn't seem like a useful thing to do. If you intended to print the function's return value, you could achieve that by something like this:
Serial.println(millis());

Thank's Peter, it the 2 bracket I have missed out.

johnwasser:
I suspect the problem is using Serial.println() inside rpm_fun(). I'd be surprised if serial output worked inside an interrupt service routine.

John, that's the only serial print that did work.

TimFr:

johnwasser:
I suspect the problem is using Serial.println() inside rpm_fun(). I'd be surprised if serial output worked inside an interrupt service routine.

John, that's the only serial print that did work.

Perhaps that function never completed. That would lock up everything.