function timing

Hei all, I noticed one weird thing. When loop1 “activates” (every 60s) then loop lasts 12ms less that usually. Could anybody tell me why is it like that?

#include "FastLED.h"
#include "Scheduler.h"
#define NUM_LEDS 60
#define DATA_PIN 2

CRGB leds[NUM_LEDS];
int ss = 0, mm = 0, hh = 0;
unsigned long now_1 = 0, last_time_1 = 0, now_2 = 0, last_time_2 = 0, now_3 = 0, last_time_3 = 0;

void setup()
{
	FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
	leds[ss].setRGB(0, 255, 0);
	leds[mm].setRGB(0, 0, 255);
	leds[hh].setRGB(255, 0, 0);
	Serial.begin(115200);
	Scheduler.startLoop(loop1);
	Scheduler.startLoop(loop2);
}

void loop() //change ss
{
	int i = 0; //all cycle must last 1000ms
	for (ss = 0; ss < 60; ss++)
	{
		for (i; i < 40; i++)
		{
			leds[ss] += CRGB(0, 7, 0);
			FastLED.show();
			delay(10);
		}

		delay(16);

		for (i; i >= 0; i--)
		{
			leds[ss] -= CRGB(0, 7, 0);
			FastLED.show();
			delay(10);
		}
	}
}

void loop1() //change mmutes
{
	int i = 0;
	for (mm = 0; mm < 60; mm++) //all cycle must last 60000ms
	{
		for (i; i < 40; i++) //this cycle tices 492ms
		{
			leds[mm] += CRGB(0, 0, 7);
			FastLED.show();
			delay(10);
		}

		delay(59016);

		for (i; i >= 0; i--)
		{
			leds[mm] -= CRGB(0, 0, 7); //this cycle tices 492ms
			FastLED.show();
			delay(10);
		}
	}
	yield();
}

void loop2() //change hour
{
	int i = 0;
	for (hh = 0; hh < 60; hh = hh + 5) //all cycle must last 3600000ms
	{
		for (i; i < 40; i++)
		{
			leds[hh] += CRGB(7, 0, 0);
			FastLED.show();
			delay(10);
		}

		delay(3599016);

		for (i; i > 0; i--)
		{
			leds[hh] -= CRGB(7, 0, 0);
			FastLED.show();
			delay(10);
		}
	}
	yield();
}

I don't want to appear picky, but where is the loop2() function and what sets the frequency of operation of the scheduled events ?

I did not notice any loop2() in the code you posted.

How are you measuring the execution time of loop()?

sorry, my bad, I ment Loop1. fixed question*

I still see a reference to loop2 and don't know what sets the frequency of operation using the Scheduler library

There is nothing that sets the frequency of scheduler operation. How that can help me?

I am not familiar with the Scheduler library. but from its name I imagined that it allowed you to schedule actions to take place at given times, but it seems not and that it is an attempt to implement a rudimentary multitasking system

By the way, where is the loop2() function ?

copied all code now
as much as I read the scheduler calls out other thread during delay() function but even then why it lasts less time than is should

copied all code now

OK, but I wish that you had not done it by revising your original post as it makes a nonsense of comments about it. Please don't do that again.