# Script Duration

This Databox reads from a [System Values](/product-suite/admin/entities/databoxes/system-values.md) **Databox** that represents the current date and time and stores this in the Databox **Keyfax.Timer started** at the point that you wish to start timing.&#x20;

### Databox Creation

You will first need to create the [System Values](/product-suite/admin/entities/databoxes/system-values.md) Databox as shown below\...

<div align="center"><figure><img src="/files/gi3Sj6nq1p123yTA7PLr" alt=""><figcaption><p>The current date and time</p></figcaption></figure></div>

<div align="center"><figure><img src="/files/SJCEhsTyydEeqz9c8jUr" alt=""><figcaption><p>Recording exactly when the timer started...</p></figcaption></figure></div>

<div align="center"><figure><img src="/files/uMP36D8qIlyLK40jkgmC" alt=""><figcaption><p>Calculating the difference using a SQL query</p></figcaption></figure></div>

### End Result

This can be demonstrated in a simple script comprising 3 steps. The first saves the current time, the second is a random question and the third displays a message showing the time spent. &#x20;

<figure><img src="/files/CNBhwMKEv0NMrX1WL7q3" alt=""><figcaption><p>Demonstrating how to use the timer</p></figcaption></figure>

Here is the message...

<figure><img src="/files/IgLSrTL37BFxy00Zy3Sm" alt=""><figcaption><p>The Message used in the above script</p></figcaption></figure>

And the final output...

<figure><img src="/files/DUdmJzqe98psrOXeZtVH" alt=""><figcaption><p>Message showing results of time spent in script</p></figcaption></figure>

{% hint style="info" %}
**NOTE:** The actual time spent in the script may be usefully returned to the host or calling application. The timer would normally be started in a **Startup Script** and the number of seconds could be returned to the host in a **Results Script**.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.keyfax.biz/product-suite/admin/databox-examples/script-duration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
