I created an example data table

And then I ran the following JSL
Names Default To Here(1); // Ensure scope is local for column references
dt = Current Data Table(); // Reference to the active data table
// Add a new numeric column "Time (s)" with the specified formula
dt << New Column( "Time (s)",
Numeric, Continuous, Format( "Best", 12 ), // numeric format (optional)
Formula(
If(
Row() == 1,
// Case 1: First row of the table -> start at 0 seconds
0,
:Name("Name") != Lag( :Name("Name") ),
// Case 2: Identifier changed from the previous row -> new run, reset time to 0
0,
// Case 3: Otherwise (same run as previous row) -> accumulate time difference
Lag( :Name("Time (s)") ) + ( :LocalTime - Lag( :LocalTime ) )
)
)
)
dt << New Column( "ElapsedTime", numeric, continuous, Formula( :LocalTime - Col Min( :Local Time, :Name ) ) );
An got the following output

Jim