Timer() function - MapBasic - 2023

MapInfo MapBasic Reference

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapBasic
Version
2023
Language
English
Product name
MapBasic
Title
MapInfo MapBasic Reference
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:32:32.686312

Purpose

Returns the number of elapsed seconds. You can call this function from the MapBasic window in MapInfo Pro.

Syntax

Timer()

Return Value

Integer

Description

The Timer() function returns the number of seconds that have elapsed since Midnight, January 1, 1970. By calling the Timer() function before and after a particular operation, you can time how long the operation took (in seconds).

Example

Declare Sub Ubi

Dim start, elapsed As Integer 

start = Timer()
Call Ubi
elapsed = Timer() - start

elapsed now contains the number of seconds that it took to execute the procedure Ubi.