6 years, 7 months ago.

Sleep Manager API Method Location in code.

Hi I'm using ST Nucleo board nowadays. I wonder which one is best way to use sleep method.

sleep method before while statement

#include "mbed.h"

void main(void){
  sleep();
  while(true){
  }
}

sleep method before while statement

#include "mbed.h"

void main(void){
  
  while(true){
  sleep();
  }
}

References

1 Answer

6 years, 6 months ago.

It has the same power consumption.