question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Every minute on the minute

See original GitHub issue

Hello,

I am not seeing a way to do it on the minute every minute. Is there a way to do that?

* * * * * is the cron equivilent

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
PvtHaggardcommented, Oct 5, 2017
import schedule
import time

def job():
    print("Running job: " + time.asctime())

def wait():
    while int(time.time()) % 60 != 0:
        pass
    print("End wait: {}".format(time.asctime()))

wait()
schedule.every(1).minutes.do(job)

while True:
    schedule.run_pending()
    time.sleep(1)

This will do what you are wanting. wait() simply stalls the program until the time is 0 seconds and then goes on to schedules the jobs.

The output from the short time I was running it.

End wait: Fri Oct  6 03:13:00 2017
Running job: Fri Oct  6 03:14:00 2017
Running job: Fri Oct  6 03:15:00 2017
Running job: Fri Oct  6 03:16:00 2017
Running job: Fri Oct  6 03:17:00 2017
Running job: Fri Oct  6 03:18:00 2017

0reactions
WoLfuluscommented, Nov 21, 2018

Start a thread (and don’t wait for it) on the job function, so it won’t block the scheduler thread. But be aware that depending on how much time the job takes to finish, you’ll see jobs running concurrently and you’ll need to manage race conditions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

EMOM: Every Minute on the Minute Workouts and Examples
EMOM workouts are an acronym for Every Minute on the Minute. The goal is to complete a number of exercise reps within 60...
Read more >
245 EMOM Workouts (WODs) - WODwell
“EMOM” stands for Every Minute On the Minute, which is when you begin a specified number of repetitions of some movements or exercises...
Read more >
Everything You Need to Know About EMOM Workouts
“EMOM” stands for “every minute on the minute” and it's when you begin a prescribed number of reps of an exercise at the...
Read more >
The Ultimate Beginner's Guide to EMOM Workouts
EMOM stands for Every Minute On The Minute. So, an EMOM workout means you are doing a set of an exercise every minute...
Read more >
What are EMOM workouts? Give it a try with this 20-minute ...
An acronym for “every minute on the minute,” EMOM workouts challenge you to complete an exercise for a certain number of reps in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found