NUMBER OF CYCLE AN INSTRUCTION TAKES TO EXECUTE

SIR,
I WANT TO KNOW THE NUMBER OF CYCLE AN INSTRUCTION LIKE -if,else,serial.println,digitalRead,digitalWrite etc. takes to execute in arduino uno sketch.

Well, you could start by looking at the data sheet for your chosen processor. There you'll find a table of the basic machine code instructions and their clock cycles. Then you want to look at how the AVR compiler converts C++ constructs like your examples into basic machine instructions.

It is not easy to evaluate the number of cycles since C or C++ can be translated to the machine code in many different ways even if it seems to be very simple program or its part in C. In addition, small change in C can cause different translation to the machine code.
In any case there is solution for you. During the build process the .elf file is created alongside with hex and others. With the avr-objdump utility you can produce an asm listing from the .elf. For an example, this command:

avr-objdump -h -S sketch.elf > sketch.lst

will produce mixed output asm and C source. You can analyze then the listing per each asm instruction and of course each instruction has defined number of cycles for its execution. Look at the ASM instruction set for that.
It is very difficult work but in the result it will help to improve your programming skills.

A more practical solution would be to time a piece of code - something like

startMicros = micros();
for (int n = 0; n < 10000; n++) {
   digitalWrite(2, HIGH);
}
endMicros = micros();

...R

I forgot to mention the Atmel Studio has a cycle counter in debugging mode.

Budvar10:
In any case there is solution for you. During the build process the .elf file is created alongside with hex and others. With the avr-objdump utility you can produce an asm listing from the .elf. For an example, this command:

avr-objdump -h -S sketch.elf > sketch.lst

will produce mixed output asm and C source. You can analyze then the listing per each asm instruction and of course each instruction has defined number of cycles for its execution. Look at the ASM instruction set for that.
It is very difficult work but in the result it will help to improve your programming skills.

Thanks for that avr-objdump command; I have been looking for it but as it did not have any urgency I did not look very hard.

It's actually not difficult but it is very tedious work (from experience with MCS51 based microcontrollers :wink: ).

I WANT TO KNOW WHY YOU ARE YELLING

some googling will help.

are you asking for the raw instruction time ? or the instruction time if you use the Arduino bootloader and IDE ?
if you address the pin directly? of if you address it in your sketch ?