Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Loupehope authored Aug 15, 2021
1 parent c6fdb28 commit fd1729d
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,37 @@
# TITimer
Pretty timer ⏰
## Pretty timer ⏰

The library allows you to create a timer that works either with [RunLoop](#Runloop) or with [GCD](#GCD).

### Features

- Track the time even while the application is in the background. For more, see - [TimerRunMode](/Sources/TITimer/Enums/TimerRunMode.swift)
- Create a timer on a personal queue or on a special Runloop mode. For more, see - [TimerType](Sources/TITimer/Enums/TimerType.swift)
- The code is covered by tests 🙂

### Examples

#### RunLoop

```swift
timer = TITimer(type: .runloopTimer(runloop: .current, mode: .default), mode: .activeAndBackground)

timer.eventHandler = {
// handle elapsed time
}

timer.start()
timer.invalidate()
```
#### GCD

```swift
timer = TITimer(type: .dispatchSourceTimer(queue: .main), mode: .activeAndBackground)

timer.eventHandler = {
// handle elapsed time
}

timer.start()
timer.invalidate()
```

0 comments on commit fd1729d

Please sign in to comment.