Simple reaction testing
C#
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
TextManager
TypeTime
.gitignore
LICENSE
README.md
TypeTime.sln

README.md

TypeTime

TypeTime is a straightforward reaction-testing application. A while ago, I had the idea that it might be useful to test reaction time on waking up, as an estimate of whether the previous night's sleep was enough and possibly of approximate health. So far, it appears to be a valid experiment with at least some correlation.

The program works as follows:

  • Wait a small, random duration, to disrupt habit.

  • Choose a random string of pre-defined length, currently five, but intentionally made easy to change.

  • Time how long it takes the user to respond to that string.

  • Count the errors, using the Levenshtein Distance, or at least something close enough.

  • Display and log the results.

The decision as to how to combine the delay, time, length, and errors into a single metric requires some analysis.

Options

TypeTime can be configured via a configuration file. On UNIX-like systems, this will be at ~/.config/TypeTime/TypeTime.ini. On Windows (untested), it should be at TypeTime\TypeTime.ini in the user's home directory.

The configuration file looks something like...

[File]
Database=/home/youruser/wherever/activity.db
CSV=/home/youruser/wherever/activity.csv
Stdout=false

[Target]
Length=7

[Operations]
MaxDelay=5

All items are optional, with default values.

In short, the options are:

  • File/Database, a path to an SQLite3 database file for logging. Default is none.

  • File/CSV, a path to a CSV file for logging. Default is none.

  • File/Stdout, for logging to stdout. Default is false.

  • Target/Length, specifies the length of the target string to be typed. Default is 5.

  • Operations/MaxDelay, specifies the maximum (random) duration to wait before revealing the target string. Default is 4.

The File options are all independent. If you want to log to output, a CSV file, and a database, that will work.

Build

TypeTime uses Nini, but does not ship with it. You will need to download the latest copy and drop it into the TextManager folder.

After that, open TypeTime.sln, build, and run.

Note that TextManager.exe currently contains not just the library functions used by TypeTime, but is also a standalone executable with the equivalent console functionality.

Logging

TypeTime logs either to a CSV file or an SQLite database, each with the following fields.

  • date, a text field, for the day's date. Currently no time, because I only use it on waking up.

  • day, a text field with the day of the week. Obviously not necessary, but handy for quick review.

  • delay, an integer field, representing the number of seconds the program waited before showing the target string.

  • length, an integer field, the number of characters in the target string.

  • errors, an integer field, the Levenshtein distance between the target string and the user input.

  • time, a real field, the user response time (in seconds).

The CSV format and the database schema are the same.

Status

I previously wrote a version in C that still has a few more features like logging (which I can release, if anybody really wants it), but am migrating tools away from the command line. So, this seemed like a perfect candidate for .NET/Mono.

At this time, both the console and GUI versions mostly work. There is a fair amount of configuration built-in, but the options are hardcoded for the moment. Currently, only the database file is user-configurable as the single command-line option.

Potential Issues

The big issue that might interest somebody is that logging to SQLite databases occurs through Mono.Data.Sqlite, meaning that TypeTime will not operate under .NET. There is a .NET implementation of the SQLite libraries, System.Data.Sqlite, which may well be functionally identical. That will require testing.

There appears to be some sort of GTK+ race condition that occasionally prevents the application from being usable. Too often for the program to be reliable, an error of (TypeTime:pid): GLib-CRITICAL **: Source ID some id was not found when attempting to remove it gets issued during the course of executing the HandleElapsed() method. When it happens (always when the program's delay is non-trivial), the entry box will not accept focus.

Credits

The icon is made up of a slightly modified Keyboard by David Cadusseau from The Noun Project and Watch by George Tsatalios (also) from The Noun Project.

To manage configuration files, TypeTime uses Nini.