feat add microprile examples
Some checks failed
sm-rpc / build (Release, host.gcc) (push) Failing after 11m15s
sm-rpc / build (Release, arm-linux-gnueabihf) (push) Failing after 11m28s
sm-rpc / build (Release, aarch64-linux-gnu) (push) Failing after 11m50s
sm-rpc / build (Debug, mipsel-linux-gnu) (push) Failing after 12m3s
sm-rpc / build (Debug, host.gcc) (push) Failing after 12m13s
sm-rpc / build (Debug, arm-linux-gnueabihf) (push) Failing after 12m30s
sm-rpc / build (Debug, aarch64-linux-gnu) (push) Failing after 12m42s
sm-rpc / build (Release, mipsel-linux-gnu) (push) Failing after 14m53s
Some checks failed
sm-rpc / build (Release, host.gcc) (push) Failing after 11m15s
sm-rpc / build (Release, arm-linux-gnueabihf) (push) Failing after 11m28s
sm-rpc / build (Release, aarch64-linux-gnu) (push) Failing after 11m50s
sm-rpc / build (Debug, mipsel-linux-gnu) (push) Failing after 12m3s
sm-rpc / build (Debug, host.gcc) (push) Failing after 12m13s
sm-rpc / build (Debug, arm-linux-gnueabihf) (push) Failing after 12m30s
sm-rpc / build (Debug, aarch64-linux-gnu) (push) Failing after 12m42s
sm-rpc / build (Release, mipsel-linux-gnu) (push) Failing after 14m53s
This commit is contained in:
31
examples/microprofile_demo.cc
Normal file
31
examples/microprofile_demo.cc
Normal file
@@ -0,0 +1,31 @@
|
||||
#include <microprofile.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <chrono>
|
||||
#include <thread>
|
||||
|
||||
MICROPROFILE_DEFINE(MAIN, "MAIN", "Main", MP_AUTO);
|
||||
|
||||
void Test()
|
||||
{
|
||||
MICROPROFILE_TIMELINE_SCOPE(MP_AUTO, "one");
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
MicroProfileOnThreadCreate("Main");
|
||||
MicroProfileSetEnableAllGroups(true);
|
||||
MicroProfileSetForceMetaCounters(true);
|
||||
printf("port: %d\n", MicroProfileWebServerPort());
|
||||
MicroProfileStartAutoFlip(30);
|
||||
|
||||
while (true)
|
||||
{
|
||||
MICROPROFILE_SCOPE(MAIN);
|
||||
Test();
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
}
|
||||
MicroProfileStopAutoFlip();
|
||||
MicroProfileShutdown();
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user