Skip to content

Prastiwar/UnityMeasure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UnityMeasure

Easily measure your code with this library

GitHub last commit license GitHub forks GitHub stars GitHub watchers GitHub contributors

GitHub repo size in bytes GitHub issues GitHub closed issues GitHub pull requests GitHub closed pull requests

Made with Unity

Before start

  • Make sure you have at least Unity 2017.4.10f1 (previous versions weren't tested).

Getting Started

See our wiki for documentation.

Using

using System;
using TP.Measurement; // import this namespace to use the library

public class TestScript : TPTestScript
{
    // Return all Action you want to automatically measure
    protected override Action[] GetActionsToMeasure()
    {
        return new Action[] {
            Void, // Void is empty method from TPTestScript
            // ()=> { MyMethod(); },
            ()=> { bool isUntagged = gameObject.tag == "Untagged"; },
            ()=> { bool isUntagged = gameObject.CompareTag("Untagged"); },
            ()=> { bool isUntagged = gameObject.tag.Equals("Untagged"); }
        };
    }

    // Calls after Unity's Start method
    protected override void OnStarted()
    {
        MeasureAverageRepeat(); // automatically measures all action from GetActionsToMeasure()
        TPMeasure.Measure("My custom measure", () => { /* code */ }).ShowLog();
    }

    // Code in this section will be showed in Unity's profiler
    protected override void UpdateProfile()
    {
        // code
    }

    private void MyMethod()
    {
        // code
    }
}

Settings:

Settings

Results:

Results

Contributing

You can freely contribute with us by reporting issues and making pull requests!
Please read CONTRIBUTING.md for details on contributing.

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

About

Library for fast measuring your code

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages