Problem detecting duration of function

First timer here.
I’m writing a code for controlling two DC motors with a L298N driver.

Since i’m quite new to Arduino, i’ve searched for an example code to take inspiration from, and, with some “reverse engineering” (or coding) i’ve tried to understand it and adapt it for my purposes.

I’ve got this quite interesting code that goes like this:

#include <Robojax_L298N_DC_motor.h>
// motor 1 settings
#define IN1 13 
#define IN2 12
#define ENA 11 // this pin must be PWM enabled pin

// motor 2 settings
#define IN3 8
#define IN4 7
#define ENB 9 // this pin must be PWM enabled pin

const int CW  = 1; // do not change
const int CCW = 2; // do not change

#define motor1 1 // do not change
#define motor2 2 // do not change

Robojax_L298N_DC_motor motor(IN1, IN2, ENA, IN3, IN4, ENB, true);

void setup() {
  Serial.begin(115200);
  motor.begin();
}

   void Forward(){
    for(int i=20; i<40; i++){
      motor.rotate(motor1, i, CW);
      motor.rotate(motor2, i, CCW);
      delay(200);
   }
  }

  void Reverse(){
    for(int i=20; i<60; i++){
      motor.rotate(motor1, i, CCW);
      motor.rotate(motor2, i, CW);
      delay(200);
    }
  }
  
  void Brake(){
    delay (4000);
    motor.brake(1);
    motor.brake(2);
  }

  void Turn_left(){
    motor.brake(1);
    motor.rotate(motor2, 50, CCW);
  }

  void Turn_right(){
    motor.brake(2);
    motor.rotate(motor1, 50, CW);
  }

  void Left_on_place(){
    motor.rotate(motor1, 20, CW);
    motor.rotate(motor2, 20, CCW);
    }

  void Right_on_place(){
    motor.rotate(motor1, 20, CCW);
    motor.rotate(motor2, 20, CW);
  }


  void TEST(){
    delay(5000);
    Forward();
    Brake();
    Reverse();
    Brake();
    Turn_left();
    Brake();
    Turn_right();
    Brake();
    Left_in_place();
    Brake();
    Right_in_place();
    Brake();
    delay(5000);
  }
 

void loop() {

    Left_on_place();
    Brake();
    delay(3000);
 }

So here’s my problem: i cant find where’s the instruction in the code to determine for HOW LONG the function “Left_on_place()” is running.
I’ve tried adding some delays inside the defined function (in “void setup()”, before calling it) but nothing changes. Looks like the two DC motors run for a pre-determined period of time, probably declared into the library “Robojax_L298N_DC_motor.h” (attached)

I’ve examined this library, but unfortunately i couldnt get where the duration is declared.

Thanks for your time

Robojax_L298N_DC_motor.h (1.96 KB)

Solved. I put a delay BEFORE every motor.brake, causing every function to run for 4secs straight before stopping

How long do you think Left_on_place() will take? Are you measuring microseconds, milliseconds, seconds...?