2 years, 5 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

2 years, 4 months ago.

It has the same power consumption.