3
Contributors
5
Replies
36
Views
4 Years
Discussion Span
Last Post by germ
0

shouldnt this be correct

dif = datetime.datetime.now().time() - datetime.datetime("18:56:18.867128")

or what is the correctway ?

1

simple example

# Simple Example

import datetime

def first_task():
    count_loop = 0
    while count_loop <> 100000000:
      a = 2**38
      count_loop += 1


def main():
    """ main() = none
    """
    # start time
    start = datetime.datetime.now()
    first_task()

    # end time
    end = datetime.datetime.now()

    # total time taken
    total_time = end - start
    print 'Total_Time: %s' % total_time

if __name__ == '__main__':
    main()
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.