Skip to content

KitsunebiGames/superluminal_d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Superluminal Performance API for D

This is a binding to the Superluminal Performance API headers for D.

You will need to have Superluminal installed for this to work.
By default the dynamic configuration is used, for this configuration you will need to add version "EnablePerfAPI" to your dub configuration to enable the performance api. This allows you to turn it off while not profiling.

When the performance API is turned off, all function calls to it will be directed to dummy implementations.

Example

import superluminal.performance;

void main() {
    PerformanceAPI_Functions perfApi;
    auto module_ = loadAPIFrom("PerformanceAPI.dll", &perfAPI);

    // Add instrumentation event
    {
        perfAPI.beginEvent("My Event", null, PERFORMANCEAPI_DEFAULT_COLOR);

        // Long running code goes here.

        perfAPI.endEvent();
    }

    // You can unload the API after you're done using it.
    unloadAPI(module_);
}

About

D bindings for the Superluminal Performance API headers

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages