Skip to content

Instantly share code, notes, and snippets.

@jacobvanorder
Created October 19, 2016 16:08
Show Gist options
  • Save jacobvanorder/d0f105d2bb9ede4515e534de86ae3ba2 to your computer and use it in GitHub Desktop.
Save jacobvanorder/d0f105d2bb9ede4515e534de86ae3ba2 to your computer and use it in GitHub Desktop.
iOS Swift Start Up Measurement from main
//
// AppDelegate.swift
//
// Created by Jacob Van Order on 10/19/16.
//
//
import UIKit
//@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
//…
func applicationDidBecomeActive(_ application: UIApplication) {
let nowTime = CFAbsoluteTimeGetCurrent()
NSLog("Start up in:\(abs(StartTime - nowTime))")
}
//…
}
//
// main.swift
//
// Created by Jacob Van Order on 10/19/16.
//
//
import UIKit
let StartTime = CFAbsoluteTimeGetCurrent()
UIApplicationMain(CommandLine.argc,
UnsafeMutableRawPointer(CommandLine.unsafeArgv).bindMemory(to: UnsafeMutablePointer<Int8>.self, capacity: Int(CommandLine.argc)),
nil,
NSStringFromClass(AppDelegate.self))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment