MobilityDB 1.3
Loading...
Searching...
No Matches
Macros | Functions
tint_creation.c File Reference

A simple program that compares the execution time to create a given number of temporal integer instants using two different methods. More...

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <meos.h>
#include <meos_internal.h>

Macros

#define MAX_INSTANTS   500000
 
#define MAX_LENGTH_INST   64
 

Functions

int main (void)
 

Detailed Description

A simple program that compares the execution time to create a given number of temporal integer instants using two different methods.

The program can be build as follows

gcc -Wall -g -I/usr/local/include -o tint_benchmark tint_benchmark.c -L/usr/local/lib -lmeos

The output of the program is as follows

Number of instants to generate: 500000
The generation using 'temporal_in' took 0.389140 seconds
The generation using 'tinstant_make()' took 0.022794 seconds
TInstant * tinstant_make(Datum value, meosType temptype, TimestampTz t)
Return a temporal instant from the arguments.
Definition: tinstant.c:203
Temporal * temporal_in(const char *str, meosType temptype)
Return a temporal value from its Well-Known Text (WKT) representation.
Definition: temporal.c:805