Lasso Soft Inc. > Home

[lp_page_timer]

Linklp_page_timer
AuthorBil Corry
CategoryUtility
Version8.x
LicensePublic Domain
Posted02 Dec 2005
Updated02 Dec 2005
More by this author...

Description

Returns the elapsed time in milliseconds.
           
_date_msec rolls over to zero once a day (?), so there will be one time per day that maybe it will return a large, negative number.
           
[lp_page_timer] returns the elapse time in milliseconds except when first called (default is it returns nothing)
           
[lp_page_timer: -showfirst] will return zero on the first call instead.
           
Calling it multiple times will cause it to return elapse seconds between each call.

Note: creates a page-only variable called "lp_page_timer" to store the clock_ticks value.

Sample Usage

[lp_page_timer]
[sleep: 50]
[lp_page_timer]
[sleep: 200]
[lp_page_timer]
[sleep: 10]
[lp_page_timer]

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.

[ 

define_tag: 'lp_page_timer',
		-description='Returns the elapsed time in milliseconds.
			
			_date_msec rolls over to zero once a day (?), so there will be one time per day that *maybe* it will return a large, negative number
			
			usage: [lp_page_timer] returns the elapse time in milliseconds except when first called (default is it returns nothing)
			
			[lp_page_timer: -showfirst] will return zero on the first call instead
			
			calling it multiple times will cause it to return elapse seconds between each call
			
			note: creates a page-only variable called "lp_page_timer" to store the clock_ticks value
			',
		 -priority='replace';

	if: var_defined:'__lp_page_timer';
		local:'prev' = $__lp_page_timer;
		$__lp_page_timer = _date_msec;
		return: integer: ($__lp_page_timer - #prev);
	else;
		var:'__lp_page_timer' = _date_msec;
		if: params->size > 0;
			return: integer: 0;
		/if;
	/if;	
/define_tag;

]

Related Tags

Comments

No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft