The TaskScheduler was introduced in commit TrinityCore/TrinityCore@da77a90 and TrinityCore/TrinityCore@151a0f5 as a better alternative to eventmap.
It is adapted to the current needs of scripting which means scheduling of event between a random range, schedulling with readable std::chrono constants, repeating of events and more.
See this script for a short usage example