From ad1b4b8c22b019d300af6d053e120fc830512ebd Mon Sep 17 00:00:00 2001 From: zxd <zxdvslxy@gmail.com> Date: 星期三, 20 九月 2023 17:08:10 +0800 Subject: [PATCH] 部分修改提交 1.横线竖线 2.部分转换功能 --- MyLib/Functions.hpp | 37 +++++++++++++++++++++++++++++++++++++ 1 files changed, 37 insertions(+), 0 deletions(-) diff --git a/MyLib/Functions.hpp b/MyLib/Functions.hpp index 18ebecb..877e200 100644 --- a/MyLib/Functions.hpp +++ b/MyLib/Functions.hpp @@ -74,6 +74,25 @@ // timeinter1=time2-time1; return (time1*1000); }; +inline double GetTimemS() +{ + LARGE_INTEGER perfreq; + LARGE_INTEGER percounter1; //,percounter2; + double time1; //,time2,timeinter1; + QueryPerformanceFrequency(&perfreq); + QueryPerformanceCounter(&percounter1); + // percounter1.QuadPart=rdtsc(); + /* _asm { + RDTSC; + mov percounter1.LowPart,eax; + mov percounter1.HighPart,edx; + } + */ + time1 = (double)percounter1.QuadPart / perfreq.QuadPart; + // time2=(double)percounter2.QuadPart/perfreq.QuadPart ; + // timeinter1=time2-time1; + return (time1 * 1000); +}; /* template <class ST> int Split(ST s1,ST divider, ST resultstr[]) @@ -219,6 +238,24 @@ } return i; } +inline void DivideStringToArray(const CString& strSrc, const CString& strSeparator, CStringArray &arrayDest) +{ + int startIndex = 0; + while (startIndex < strSrc.GetLength()) + { + int endIndex = strSrc.Find(strSeparator, startIndex); + + if (endIndex == -1) + { + endIndex = strSrc.GetLength(); + } + + arrayDest.Add( + strSrc.Mid(startIndex, endIndex - startIndex)); + + startIndex = endIndex + strSeparator.GetLength(); + } +} //*/ inline WCHAR* ToWChar(char * str) { -- Gitblit v1.9.1