ProductPromotion
Logo

Swift

made by https://0x3d.site

GitHub - tapwork/WatchdogInspector: Shows your current framerate (fps) in the status bar of your iOS app
Shows your current framerate (fps) in the status bar of your iOS app - tapwork/WatchdogInspector
Visit Site

GitHub - tapwork/WatchdogInspector: Shows your current framerate (fps) in the status bar of your iOS app

GitHub - tapwork/WatchdogInspector: Shows your current framerate (fps) in the status bar of your iOS app

WatchdogInspector

Shows your current framerate (fps) in the status bar of your iOS app

Be a good citizen! Don't block your main thread!

Build Status Cocoapods Version CocoaPods Platform Carthage Compatible Twitter

WatchdogInspector counts your app's framerate and displays the fps in the status bar. The coloured status bar lets you know when your framerate drops below 60 fps. If everything is fine your status bar gets happy and will stay green. To detect unwanted main thread stalls you can set a custom watchdog timeout.

Features

  • Status bar displays the current framerate in fps (measured every 2 seconds)
  • Colours the status bar from green (good fps) to red (bad fps)
  • Custom watchdog timeout: Exception when main thread stalls for a defined time

screencast

Install

CocoaPods

pod "WatchdogInspector"

and run pod install You can see the example project how to setup and run WatchdogInspector Make sure that you don't use WatchdogInspector in production.

Carthage

You can use Carthage. Specify in Cartfile:

github "tapwork/WatchdogInspector"

Usage

Objective-C | Swift

Start

After launch or whenever you want.

import WatchdogInspector
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
        TWWatchdogInspector.start()
        return true
}

Stop

To stop it just call

TWWatchdogInspector.stop()

Main Thread Stalling Exceptions

You can set a custom watchdog timeout for stalling exceptions (Default: 3 seconds)

TWWatchdogInspector.setStallingThreshhold(10.0)

You could also disable the Main Thread exceptions

TWWatchdogInspector.setEnableMainthreadStallingException(false)

Logging

To log all measured framerates you can log them in the console by calling (Default: on)

TWWatchdogInspector.setUseLogs(true)

How it works

There are basically two timers running to measure the framerate.

  1. The background thread timer fires every 2 seconds to count how many frames were set by the main thread. Ideally the result would be 120 frames in 2 seconds to get 60 fps. The background timer resets the frames counter every event. He also sends the measured fps to the status bar on the main thread.

  2. The main thread timer should fire every 1/60 second (60 fps is optimum for a smooth animation) to increment the frames counter. If the main thread is blocked and can't run every 1/60 second the framerate will drop the 60 fps.

There is also a run loop observer running to detect main thread stalls for a defined timeout. If the timeout has been reached an exception will be thrown.

Related projects

Author

License

MIT

More Resources
to explore the angular.

mail [email protected] to add your project or resources here ๐Ÿ”ฅ.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here ๐Ÿ”.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory