Revision c7f486c57cec2aae901dec6123fc57dfb5133f46 authored by Ellie Hermaszewska on 11 February 2023, 04:16:56 UTC, committed by GitHub on 11 February 2023, 04:16:56 UTC
Although we could in principle write this explanatory message to stderr, that
would entangle this call with the layer search above for what is probably a
very unlikely possibility on any normal system.
1 parent aec57d8
Raw File
slang-profile-main.cpp
// slang-profile-main.cpp

#include "../../source/core/slang-io.h"
#include "../../source/core/slang-std-writers.h"

#include "../../source/core/slang-process-util.h"

#include "../../slang-com-helper.h"

#include "../../source/core/slang-string-util.h"

using namespace Slang;

SlangResult innerMain(int argc, char** argv)
{
    auto stdWriters = StdWriters::initDefaultSingleton();

    // Time the creation of the session
    {
        const auto startTick = ProcessUtil::getClockTick();

        for (Int i = 0; i < 32; ++i)
        {
            ComPtr<slang::IGlobalSession> slangSession;
            slangSession.attach(spCreateSession(nullptr));
        }

        const auto endTick = ProcessUtil::getClockTick();

        printf("Ticks %f\n", double(endTick - startTick) / ProcessUtil::getClockFrequency());
        return SLANG_OK;
    }

    return SLANG_OK;
}

int main(int argc, char** argv)
{
    const SlangResult res = innerMain(argc, argv);
#ifdef _MSC_VER
    _CrtDumpMemoryLeaks();
#endif
    return SLANG_SUCCEEDED(res) ? 0 : 1;
}
back to top