Timekeeper is an easy-to-use time measurement library written in Swift, with support for iOS, tvOS, watchOS and macOS.

Overview

Timekeeper

Build Documentation

Timekeeper is an easy-to-use time measurement library written in Swift, with support for iOS, tvOS, watchOS and macOS.

Installation

Timekeeper is available via the Swift Package Manager which is a tool for managing the distribution of Swift code. It’s integrated with the Swift build system and automates the process of downloading, compiling, and linking dependencies.

Once you have your Swift package set up, adding Timekeeper as a dependency is as easy as adding it to the dependencies value of your Package.swift.

dependencies: [
    .package(
        url: "https://github.com/aplr/Timekeeper.git",
        .upToNextMajor(from: "0.0.1")
    )
]

Usage

import Timekeeper

// Start a new timing
Timekeeper.shared.start("measurement")

// Print the elapsed time since start
Timekeeper.shared.lap(print: "measurement")

// Print the elapsed time since the last lap
Timekeeper.shared.lap(print: "measurement")

// Print the elapsed time since the last lap and start and clears the timing
Timekeeper.shared.stop(print: "measurement")
// Start a new timing
Timekeeper.shared.start("measurement")

// Add a new lap and return the timing
let measurement = Timekeeper.shared.lap("measurement")

// Stop the timer and return the timing
let measurement = Timekeeper.shared.stop("measurement")

Documentation

Documentation is available here and provides a comprehensive documentation of the library's public interface.

License

Timekeeper is licensed under the MIT License.

You might also like...
SwiftDate πŸ” Toolkit to parse, validate, manipulate, compare and display dates, time & timezones in Swift.
SwiftDate πŸ” Toolkit to parse, validate, manipulate, compare and display dates, time & timezones in Swift.

Toolkit to parse, validate, manipulate, compare and display dates, time & timezones in Swift. What's This? SwiftDate is the definitive toolchain to ma

Custom Time Picker ViewController with Selection of start and end times in Swift πŸ”Ά
Custom Time Picker ViewController with Selection of start and end times in Swift πŸ”Ά

LFTimePicker Custom Time Picker ViewController with Selection of start and end times in Swift πŸ”Ά . Based on Adey Salyard's design @ Dribbble One to tw

NVDate is an extension of NSDate class (Swift4), created to make date and time manipulation easier.

NVDate is an extension of NSDate class (Swift4), created to make date and time manipulation easier. NVDate is testable and robust, we wrote intensive test to make sure everything is safe.

Time Lines - Know when all your friends, colleagues, and family are
Time Lines - Know when all your friends, colleagues, and family are

Time Lines Know when all your friends, colleagues, and family are. Time Lines is a practical app to know when all your friends, colleagues and family

This Control is a beautiful time-of-day picker heavily inspired by the iOS 10
This Control is a beautiful time-of-day picker heavily inspired by the iOS 10 "Bedtime" timer.

#10Clock Dark and Mysterious πŸ•Ά Light Colors 🌻 Usage The control itsself is TenClock. Add that to your view hierarchy, and constrain it to be square

Better time picker for iOS.

TimePicker Better TimePicker for iOS Requirements Swift 5.0 iOS 10.0+ Xcode 10.2+ Installation The easiest way is through CocoaPods. Simply add the de

The goal is a simple iOS app that draws an analog clock of the current time

Qrono This is a work-in-progress. The goal is a simple iOS app that draws an analog clock of the current time (as well as displaying a digital readout

πŸ•° Type-safe time calculations in Swift

Time This micro-library is made for you if: You have ever written something like this: let interval: TimeInterval = 10 * 60 To represent 10 minutes. U

Swifty Date & Time API inspired from Java 8 DateTime API.

AnyDate Swifty Date & Time API inspired from Java 8 DateTime API. Background I think that date & time API should be easy and accurate. Previous dates,

Releases(0.0.2)
Owner
Andreas Pfurtscheller
Andreas Pfurtscheller
A "time ago", "time since", "relative date", or "fuzzy date" category for NSDate and iOS, Objective-C, Cocoa Touch, iPhone, iPad

Migration 2014.04.12 NSDate+TimeAgo has merged with DateTools. DateTools is the parent project and Matthew York is the project head. This project is n

Kevin Lawler 1.8k Dec 2, 2022
Date and time manager for iOS/OSX written in Swift

Tempo was designed to work both in OSX and in iOS (7.0+). Work with the time or dates can be cumbersome, iOS development. Tempo allows you to deal easly with date and time. Basics manipulations are already implemented in Tempo.

Remi ROBERT 153 Jun 3, 2021
NTP library for Swift and Objective-C. Get the true time impervious to device clock changes.

TrueTime for Swift Make sure to check out our counterpart too: TrueTime, an NTP library for Android. NTP client for Swift. Calculate the time "now" im

Instacart 530 Jan 4, 2023
SwiftUI library to display a clock. You can move the arms to change the time, change the style of the clock and customise some configurations.

SwiftClockUI Clock UI for SwiftUI This library has been tested βœ… ?? macOS Catalina 10.15.3 βœ… ?? macOS Big Sur 11.6 βœ… ?? iOS 13 βœ… ?? iOS 14 βœ… ?? iOS 15

Renaud Jenny 239 Dec 29, 2022
Building a better date/time library for Swift

Time Time is a Swift package that makes dealing with calendar values a natural and straight-forward process. Working with calendars can be extremely c

Dave DeLong 2k Dec 31, 2022
Create your own faces for watchOS. Customize the watch hands, layout, colors, and images. Edit faces on your phone and switch them on the watch.

AppleWatchFaces Design your own watch faces for the apple watch. They are not real watch faces, but a watchOS app running on the watch that tells you

Mike Hill 395 Oct 20, 2022
A customizable date picker for watchOS and SwiftUI.

Watch Date Picker A customizable date picker for watchOS and SwiftUI. Installation .package(url: "https://github.com/freyaariel/watch-date-picker.git"

Freya Ariel 30 Dec 4, 2022
A TimeZonePicker UIViewController similar to the iOS Settings app. Search and select from a range of cities and countries to find your most suitable time zone.

TimeZonePicker A TimeZonePicker UIViewController similar to the iOS Settings app. Search and select from a range of cities and countries to find your

Gligor Kotushevski 125 Dec 13, 2022
A basic countdown app that allows the user to create, edit, and delete events. Each event contains a live countdown timer to a specified date and time.

Event Countdown App (iOS) Created by Lucas Ausberger About This Project Created: January 4, 2021 Last Updated: January 8, 2021 Current Verison: 1.1.1

Lucas Ausberger 1 Jan 8, 2022
Time is a Swift package that makes dealing with calendar values a natural and straight-forward process.

Time Time is a Swift package that makes dealing with calendar values a natural and straight-forward process. Working with calendars can be extremely c

Dave DeLong 2k Dec 31, 2022