# 17 Coordinating timelines
## There’s a bug! (after optimization)

## Identify actions: Step 1

## Draw each action: Step 2

## Simplify the diagram: Step 3
### JavaScript threading model simplification steps
1. All actions on a single timeline go into a single box.
2. Consolidate timelines that end by creating one new timeline.


## Possible ordering analysis

## Why this timeline is faster

## Waiting for both parallel callbacks

## A concurrency primitive for cutting timelines


## Using Cut() in our code


### Promise.all

https://stackoverflow.com/a/52669775/5247640
## Uncertain ordering analysis

## Parallel execution analysis

## Multiple-click analysis

## A primitive to call something just once

## Implicit versus explicit model of time

## Summary: Manipulating timelines
