# Elasped Secs & Is There A Reference For Custom Scheduling?

**URL:** <https://forums.ankiweb.net/t/elasped-secs-is-there-a-reference-for-custom-scheduling/55563>\
**Category:** Scheduling\
**Created:** [February 8, 2025, 5:31pm UTC](https://forums.ankiweb.net/t/elasped-secs-is-there-a-reference-for-custom-scheduling/55563 "2025-02-08T17:31:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RRomeroJr](https://avatars.discourse-cdn.com/v4/letter/r/df788c/32.png) [@RRomeroJr](https://forums.ankiweb.net/u/RRomeroJr)\
**Post date:** [February 8, 2025, 5:31pm UTC](https://forums.ankiweb.net/t/elasped-secs-is-there-a-reference-for-custom-scheduling/55563/1 "2025-02-08T17:31:32Z")

</div>

Well first off,

1. Is there a reference for what information is available to you in the custom scheduler and what it means.  
I’m aware this [link](https://github.com/ankitects/anki/blob/main/proto/anki/scheduler.proto) from the [deck options](https://docs.ankiweb.net/deck-options.html) in the manual, but neither are very descriptive of what everything means.

I ask because

1. I’m trying to incorporate “over due time” for learning cards. Make them progress faster if you answer correctly past the due time.

I thought I could use **learning.elapsedSecs** for this but it doesn’t seem to behave the way I expect. When I log it, it frequently does weird things.

- [Example screenshot 1:](https://imgur.com/a/elQTN8c) Delay in info =/= elapsedSecs
- [Example screenshot 2a:](https://imgur.com/a/pNOgluB) elapsed only shows time after it was **actually** scheduled for _(not what scheduledSecs is)_ and underflows before that?
- [Example screenshot 2b:](https://imgur.com/a/mtDZwzT) shows underflow

My scheduler code during these screenshots

```auto
/**
 * @param {ReviewStates} states 
 */
let main = (states) => {
    /**
     * @param {AnswerButton} _state 
     * @returns {LearningState}
     */
    let getLearningState = (_state) => {
        if (states.current.filtered) {
            return _state.filtered.rescheduling.originalState;
        }
        return _state.normal;
    }
    let current = getLearningState(states.current);
    // let again = getLearningState(states.again);
    // let hard = getLearningState(states.hard);
    let good = getLearningState(states.good);
    // let easy = getLearningState(states.easy);
    if (current.learning) {
        let eSecs = current.learning.elapsedSecs;
        console.log(
        "current", JSON.stringify(current, null, 1.6) +
        `\n incorporating ${eSecs} secs!\n ` ,
        "hours: ", Math.floor(eSecs / (60*60)),
        " mins: ", Math.floor((eSecs % (60*60)) / 60),
        " secs: ", Math.floor((eSecs % (60*60)) % 60));
        if ( good.learning) {
            // vv Turned on for 1st screenshot vv
            //good.learning.scheduledSecs = 3*60;
        }
    }
}
// DO NOT END WITH COMMENT. PUT EXTRA LINE
main(states);

```

---

<div class="post-metadata">

**Author:** ![jhhr](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/jhhr/32/21339_2.png) [@jhhr](https://forums.ankiweb.net/u/jhhr)\
**Post date:** [February 9, 2025, 2:08pm UTC](https://forums.ankiweb.net/t/elasped-secs-is-there-a-reference-for-custom-scheduling/55563/2 "2025-02-09T14:08:27Z")

</div>

> [@RRomeroJr](#):
>
> Is there a reference for what information is available to you in the custom scheduler and what it means.

I’d like to know too, I’m guessing there isn’t one. I’ve made my own custom scheduler stuff but I never dealt with the `learning` steps, I only customized `review`.

> [@RRomeroJr](#):
>
> [Example screenshot 2b:](https://imgur.com/a/mtDZwzT) shows underflow

This looks a like clear bug in the scheduler code. Could be the case in the 2a screenshot is a bug too.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [March 11, 2025, 2:09pm UTC](https://forums.ankiweb.net/t/elasped-secs-is-there-a-reference-for-custom-scheduling/55563/3 "2025-03-11T14:09:17Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
