Quick Start
Get Gears running in under 5 minutes! This tutorial shows you the simplest way to schedule and execute jobs.
Installation
using Pkg
Pkg.add("Gears")
Your First Scheduled Job
Here's the minimal example to get you started:
using Gears
# Schedule a job to run every 200 milliseconds
every(200ms) do dt
println("Task executed at $(now(global_clock()))")
end
# Run the scheduler for 1 second
for_next(1s) do
update!()
end
That's it! This will:
- Schedule a job to print a message every 200ms
- Run the scheduler for 1 second
- Execute the scheduled task 5 times
What Just Happened?
every(200ms)
creates a timed job that runs every 200 millisecondsfor_next(1s)
runs the scheduler for 1 second of simulated timeupdate!()
processes all scheduled jobs and advances timenow(global_clock())
gets the current time from the default clock
Next Steps
Ready to learn more? Check out the Basic Scheduling tutorial to understand the fundamentals, or jump to any topic that interests you:
- Basic Scheduling - Learn job scheduling fundamentals
- Clocks and Time - Understand time control
- Job Types - Explore different job triggers
- Schedulers - Configure job execution
- Threading - Run jobs in parallel