Click here to Skip to main content
15,861,168 members
Articles / Programming Languages / Lua

ObjectScript: A new programming language

Rate me:
Please Sign up or sign in to vote.
4.24/5 (6 votes)
9 Oct 2012MIT9 min read 66K   107   21  
The ObjectScript is a new programing language that mixes benefits of JavaScript, Lua, and PHP. The ObjectScript has syntax from JavaScript, multiple results from Lua, OOP from PHP and much more.
#ifndef __PROFILE_OS_H__
#define __PROFILE_OS_H__

struct OpcodeProfile
{
	int opcode;
	int count;
	double time;

	OpcodeProfile()
	{
		opcode = 0;
		count = 0;
		time = 0;
	}
};

extern OpcodeProfile opcodes_usage[];
extern double start_opcode_time;
double getTimeSec();

#define OS_PROFILE_BEGIN_OPCODE(opcode) do{ start_opcode_time = getTimeSec(); }while(false)
#define OS_PROFILE_END_OPCODE(opcode) do{ \
	opcodes_usage[opcode].count++; \
	opcodes_usage[opcode].time += getTimeSec() - start_opcode_time; \
}while(false)

#endif //__PROFILE_OS_H__

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 MIT License


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions