forked from alexgoussev/TrackProcessor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Profiler.cpp
41 lines (32 loc) · 936 Bytes
/
Profiler.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//---------------------------------------------------------------------------
#include <vcl.h>
#include <stdio.h>
#include <io.h>
#include <dir.h>
#pragma hdrstop
#include "Profiler.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
TProfiler *pProfiler = NULL;
__fastcall TProfiler::TProfiler()
{
m_asFileName = ChangeFileExt(Application->ExeName, ".trc");
}
__fastcall TProfiler::~TProfiler()
{
//TODO: Add your source code here
}
void __fastcall TProfiler::Write(const char *pStr)
{
FILE *pDebug = fopen(m_asFileName.c_str(), "a+");
if(pDebug)
{
SYSTEMTIME SysTime;
GetLocalTime(&SysTime);
fprintf(pDebug, "%04hu-%02hu-%02hu %02hu:%02hu:%02hu.%03hu - %s\n",
SysTime.wYear, SysTime.wMonth, SysTime.wDay,
SysTime.wHour, SysTime.wMinute, SysTime.wSecond, SysTime.wMilliseconds,
pStr);
fclose(pDebug);
}
}