aboutsummaryrefslogtreecommitdiff
path: root/src/config.ts
blob: d1d369e7de92905af500005ea9b7722cc07e1b49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
export interface Config {
  warmup: number;
  prepare : number;
  tabatas : number;
  cycles : number;
  work : number;
  rest : number;
}

export function init(): Config {
  return {
    warmup: 120,
    tabatas: 4,
    prepare: 10,
    cycles: 8,
    work: 20,
    rest: 10
  }
}

export function getDuration(c: Config): number {
  return c.warmup + c.tabatas * (c.prepare + (c.cycles * (c.work + c.rest)))
}