Class
NumCosmoMathTimer
Description [src]
final class NumCosmoMath.Timer : GObject.Object
{
/* No available fields */
}
A timer with ETA support.
This object has several functions to track time, with the availability to be devided in several tasks. Also it provides two different formats: the default is time in seconds but also have date plus time. All with estimated time of accomplishment (ETA) support.
Instance methods
ncm_timer_elapsed
If nt timer has been started but not stopped, obtains the time since the timer was started.
If timer has been stopped, obtains the elapsed time between the time it was started and the time it was stopped.
The return value is the number of seconds elapsed, including any fractional part.
This function applies g_timer_elapsed()
from Glib.
ncm_timer_elapsed_dhms
The this function returns the same information as above, but now the format is in days, hours, minutes and seconds.
Those information are passed by the variables elap_day, elap_hour, elap_min and elap_sec, respectively.
ncm_timer_elapsed_dhms_str
Similar as the function above, but now the resulted time elapsed is returned in a string format.
ncm_timer_task_accumulate
This function takes a task already created and divids it in nitens.
The number of nitens must not exceed the length of the original task.
ncm_timer_task_add_tasks
This function adds ptasks to nt.
The nt task length must be greater than 0.
ncm_timer_task_completed
This function returns the number of tasks already completed.
The nt task length must be greater than 0.
ncm_timer_task_cur_datetime_str
This function returns a string with the current time of the nt task in date plus time format.
ncm_timer_task_elapsed_str
This function returns a string wiht the time needed
to complete the tasks until the program reaches it.
The nt task length must be greater than 0.
ncm_timer_task_end_datetime_str
This function returns a string with the end time of the nt task in date plus time format.
ncm_timer_task_has_ended
This function verifies if nt task has ended.
The nt task length must be greater than 0.
ncm_timer_task_increment
This function increment nt task by one.
The final task ID must be greater than the task length defined by ncm_timer_task_start ().
ncm_timer_task_log_cur_datetime
This function log the current time of the nt‘s tasks in date plus time format.
ncm_timer_task_log_end_datetime
This function log the end time of the nt‘s tasks in date plus time format.
ncm_timer_task_log_start_datetime
This function log the start time of the nt‘s tasks in date plus time format.
ncm_timer_task_mean_time_str
This function returns astring with the average time to go through each task.
ncm_timer_task_start
This function starts a task at nt with lenght task_len.
nt must not have a task already assigned to it.
task_len must be bigger than 0, task_len>0.
ncm_timer_task_start_datetime_str
This function returns a string wiht the start time of the nt task in date plus time format.
ncm_timer_task_time_left_str
This function returns a string with the time left to execute the remaining tasks.
Properties
NumCosmoMath.Timer:task-pos
The Position of the current task, varying from [0, NcmTimer:task-len - 1].
Signals
Signals inherited from GObject (1)
GObject::notify
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.