Giter VIP home page Giter VIP logo

ysfpsstatus's Introduction

YSFPSStatus

在状态栏栏上显示FPS。(ps: FPS(Frame Per Second) 是一秒钟渲染多少帧 , FPS 的值最佳为 60 左右,一般来说小于这个值就较为卡顿了。)

使用

YSFPSStatus 直接使用

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

// 只在DEBUG模式下使用
#if defined(DEBUG)||defined(_DEBUG)
    [[YSFPSStatus sharedInstance] open];
#endif

//#if defined(DEBUG)||defined(_DEBUG)
//    [[YSFPSStatus sharedInstance] openWithHandler:^(NSInteger fpsValue) {
//        NSLog(@"fpsvalue %@",@(fpsValue));
//    }];
//#endif

    return YES;
}

YSFPSLabel 自定义使用

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    ...

#if defined(DEBUG)||defined(_DEBUG)
    YSFPSLabel *fpsLabel = [[YSFPSLabel alloc] initWithFrame:CGRectMake(10, 300, 60, 30)];
//    fpsLabel.fpsHandler = ^(NSInteger fpsValue) {
//        NSLog(@"fpsvalue %@",@(fpsValue));
//    };
    [self.window.rootViewController.view addSubview:fpsLabel];
#endif

    return YES;
}

![](https://github.com/kysonyangs/YSFPSStatus/blob/master/screenshot/on_view.png)

ysfpsstatus's People

Contributors

kysonyangs avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.