void setup() {
// put your setup code here, to run once:
DDRB = _BV(PB5);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
long a = micros();
PORTB |= _BV(PB5);
long b = micros()-a;
Serial.print("Bit Operation TME:");
Serial.println(b);
delay(1000);
PORTB= B00000000;
delay(1000);
long k = micros();
digitalWrite( 13,HIGH);
long m = micros()-k;
Serial.print("Normal Op TME:");
Serial.println(m);
delay(1000);
PORTB= B00000000;
delay(1000);
}
OUTPUT :
Normal Op TME:8
Bit Operation TME:4
Normal Op TME:8
Bit Operation TME:4
Normal Op TME:8
Bit Operation TME:0
Normal Op TME:8
Bit Operation TME:4
Normal Op TME:8
Bit Operation TME:4
Normal Op TME:8
Bit Operation TME:4
Normal Op TME:8
No comments:
Post a Comment