title: How to schedule AWS Lambda to run exactly at 12:00:00 am (second-level precision)?
body: <p>I have a use case where I need to run a function <strong>daily at 12:00:00 am</strong>. My Python code takes 3-4 seconds to initialize and 3 seconds to execute. It would still be fine if my function is triggered within 1 second after 12:00:00 am, but I can't do it with AWS Lambda triggered by AWS CloudWatch.</p>
  
  <p>I have created a AWS Lambda function and it's being triggered every 11:59 pm using AWS CloudWatch Events because it <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html" rel="nofollow noreferrer">does not provide second level precision</a>. So, it's <em>wasting computing time averaging between 15 - 45 seconds</em> after initializing just to sleep until 12:00:00 am.</p>
  
  <p>Although the price is still quite low, but I just felt annoyed that the <strong>majority (>75%) of the computing time taken is used to Sleep</strong>. Anyone else has a better idea?</p>