Arduino Zero: Can it sleep for less than a second?

I'm working on some code where I'd like to be able to put the arduino zero into a low power state for a short period of time (maybe as low as around 10ms). I'm finding that in the available library 'RTCzero' you can only sleep until the next second elapses.

This is great for longer sleeps and for keeping things synchronized with the RTC but I'd love some advice on how I might be able to control a shorter sleep. Is it possible that something about how the Zero is built means that it can only sleep and wake based on the RTC?

how are you planning waking up your device?

you might want to explore timers and interrupts

arduino-watchdog

Here is the code from one of the libraries examples that I’m using:

It’s basically just setting a time to wake up at using ’ rtc.setAlarmTime(17, 00, 10);’ then using ‘rtc.standbyMode();’ to put the sensor to sleep until the time passes that the alarm was set for.

I haven’t found any other ways to put the tag to sleep, but would love some tips on how this might be done. I’m guessing there might be some registers or something that could be directly set for a simple low power mode which I then turn off to wake the tag back up. I’m just not sure where to look to figure out what I need to set.

/*
  Sleep RTC Alarm for Arduino Zero

  Demonstrates the use an alarm to wake up an Arduino zero from Standby mode

  This example code is in the public domain

  http://arduino.cc/en/Tutorial/SleepRTCAlarm

  created by Arturo Guadalupi
  17 Nov 2015
  modified 
  01 Mar 2016
  
  NOTE:
  If you use this sketch with a MKR1000 you will see no output on the serial monitor.
  This happens because the USB clock is stopped so it the USB connection is stopped too.
  **To see again the USB port you have to double tap on the reset button!**
*/

#include <RTCZero.h>

/* Create an rtc object */
RTCZero rtc;

/* Change these values to set the current initial time */
const byte seconds = 0;
const byte minutes = 00;
const byte hours = 17;

/* Change these values to set the current initial date */
const byte day = 17;
const byte month = 11;
const byte year = 15;

void setup()
{
  pinMode(LED_BUILTIN, OUTPUT);
  digitalWrite(LED_BUILTIN, LOW);

  rtc.begin();

  rtc.setTime(hours, minutes, seconds);
  rtc.setDate(day, month, year);

  rtc.setAlarmTime(17, 00, 10);
  rtc.enableAlarm(rtc.MATCH_HHMMSS);

  rtc.attachInterrupt(alarmMatch);

  rtc.standbyMode();
}

void loop()
{
  rtc.standbyMode();    // Sleep until next alarm match
}

void alarmMatch()
{
  digitalWrite(LED_BUILTIN, HIGH);
}

Edit: I think the watchdog timer link is what I need, thanks! It might be a little tricky to adapt things to the Zero, but I'll give it a shot and report back

if you use an external real time clock, indeed libraries offer a "second" based resolution.

you would need to check if your specific RTC has other modes that can trigger interrupts within milliseconds

for the zero check the work from @moresun