Click here to Skip to main content
13,768,679 members
Click here to Skip to main content

Stats

81.2K views
1.1K downloads
49 bookmarked
Posted 24 Nov 2008
Licenced CPOL

The SBJ MVC Framework - The Model, from Abstraction to Realization

, 20 Mar 2009
A Model-View-Controller Framework that integrates with the MFC Doc/View architecture
XmlMvc2090.dll
Shapes.exe
SbjCore2090.dll
Shapes
Data
res
buttons.bmp
filelarge.bmp
filesmall.bmp
filesmall.png
main.bmp
Shapes.ico
ShapesDoc.ico
Toolbar.bmp
Toolbar256.bmp
treeimages.bmp
vssver.scc
Write - Copy.png
Write.png
Write1.png
writelarge.bmp
writesmall - Copy.bmp
writesmall - Copy.png
writesmall.bmp
writesmall.png
Shapes.vcproj
XmlMvc
res
vssver.scc
XmlMvc.vcproj
SbjCore
Registry.H
res
bigcat.ico
main.bmp
properties.bmp
properties_hc.bmp
properties_wnd_hc.ico
vssver.scc
SbjCore.vcproj
CommonSettings.vsprops
CommonAppDebugSettings.vsprops
CommonAppReleaseSettings.vsprops
CommonDLLDebugSettings.vsprops
CommonDLLReleaseSettings.vsprops
#include "StdAfx.h"
#include "DebugUtils.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

namespace SbjCore
{
	namespace Utils
	{
		namespace Debug
		{
			//	Found on CodeProject, no copyright or license attached
			//	Author:		Chen Venkataraman (venkatar@sig.com)
			//	Date:		Wed Dec 6, 2001
			HighResElapsedTimer::HighResElapsedTimer(LPCTSTR strName, bool bTimeRelease /*= false*/) : 
				m_strName(strName),
				m_bTimeRelease(bTimeRelease)
			{
#ifdef _DEBUG
				if (m_llFrequency == 0)			// frequency value not yet set
				{
					LARGE_INTEGER	liFrequency;

					QueryPerformanceFrequency(&liFrequency);
					m_llFrequency = liFrequency.QuadPart;
				}

				QueryPerformanceCounter(&m_llCounter);
#else
				if (m_bTimeRelease)
				{
					if (m_llFrequency == 0)			// frequency value not yet set
					{
						LARGE_INTEGER	liFrequency;

						QueryPerformanceFrequency(&liFrequency);
						m_llFrequency = liFrequency.QuadPart;
					}

					QueryPerformanceCounter(&m_llCounter);
				}
#endif
			}

			HighResElapsedTimer::~HighResElapsedTimer()
			{
				GetTime();
			}

			CString HighResElapsedTimer::GetTime()
			{
				CString s;
#ifdef _DEBUG
				LARGE_INTEGER		liNow;
				QueryPerformanceCounter(&liNow);
				double				duration = (double)(liNow.QuadPart - m_llCounter.QuadPart)/m_llFrequency;
				s.Format(_T("%s : Elapsed time = %.5lf seconds\n"), m_strName, duration);
				TRACE(s);
#else
				if (m_bTimeRelease)
				{
					LARGE_INTEGER		liNow;
					QueryPerformanceCounter(&liNow);
					double				duration = (double)(liNow.QuadPart - m_llCounter.QuadPart)/m_llFrequency;
					s.Format(_T("%s : Elapsed time = %.5lf seconds\n"), m_strName, duration);
					TRACE(s);
				}
#endif
				return s;
			}
			
			/* static */
			LONGLONG HighResElapsedTimer::m_llFrequency = 0;


		}
	}
}


//*** Modification History ***
// $Log:  $

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

SBJ
United States United States
No Biography provided

You may also be interested in...

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web04-2016 | 2.8.181116.1 | Last Updated 20 Mar 2009
Article Copyright 2008 by SBJ
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid